return 0;
}
+static Standard_Integer scalexyz(Draw_Interpretor& di, Standard_Integer n, const char** a)
+{
+ if (n < 6) return 1;
+ TopoDS_Shape aShapeBase = DBRep::Get(a[2]);
+ if (aShapeBase.IsNull()) return 1;
+
+ Standard_Real aFactorX = atof(a[3]);
+ Standard_Real aFactorY = atof(a[4]);
+ Standard_Real aFactorZ = atof(a[5]);
+
+ gp_GTrsf aGTrsf;
+ gp_Mat rot (aFactorX, 0, 0,
+ 0, aFactorY, 0,
+ 0, 0, aFactorZ);
+ aGTrsf.SetVectorialPart(rot);
+ BRepBuilderAPI_GTransform aBRepGTrsf (aShapeBase, aGTrsf, Standard_False);
+ if (!aBRepGTrsf.IsDone())
+ Standard_ConstructionError::Raise("Scaling not done");
+ TopoDS_Shape Result = aBRepGTrsf.Shape();
+
+ DBRep::Set(a[1], Result);
+ return 0;
+}
void BRepTest::BasicCommands(Draw_Interpretor& theCommands)
{
theCommands.Add("wexplo","wexplo wire [face] create WEDGE_i",
__FILE__,
wexplo,g);
+
+ theCommands.Add("scalexyz",
+ "scalexyz res shape factor_x factor_y factor_z",
+ __FILE__,
+ scalexyz, g);
}
//OCC466(apo)->
U1 = curvU1; U2 = curvU2;
V1 = curvV1; V2 = curvV2;
- SS->Bounds(surfU1,surfU2,surfV1,surfV2);
+ SS->Bounds(surfU1,surfU2,surfV1,surfV2);
+
+ if (Abs(U1 - surfU1) <= TolPar)
+ U1 = surfU1;
+ if (Abs(U2 - surfU2) <= TolPar)
+ U2 = surfU2;
+ if (Abs(V1 - surfV1) <= TolPar)
+ V1 = surfV1;
+ if (Abs(V2 - surfV2) <= TolPar)
+ V2 = surfV2;
+
if(!IsUp){
U1 = Max(surfU1,curvU1);
U2 = Min(surfU2,curvU2);
V1 = Max(surfV1,curvV1);
V2 = Min(surfV2,curvV2);
}
- //<-OCC466(apo)
+ //<-OCC466(apo)
+
+ if (IsUp)
+ {
+ Standard_Real Up = S->UPeriod();
+ if (U2 - U1 > Up)
+ U2 = U1 + Up;
+ }
+ if (IsVp)
+ {
+ Standard_Real Vp = S->VPeriod();
+ if (V2 - V1 > Vp)
+ V2 = V1 + Vp;
+ }
+
+ /*
if(IsUp && IsVp) {
Standard_Real dU = Abs(U2 - U1), dV = Abs(V2 - V1);
Standard_Real Up = S->UPeriod(), Vp = S->VPeriod();
if(!IsUp && !IsVp) {
SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9);
}
+ */
- SS->Bounds(surfU1,surfU2,surfV1,surfV2) ;
+ if (Abs(surfU1-U1) > Tol || Abs(surfU2-U2) > Tol ||
+ Abs(surfV1-V1) > Tol || Abs(surfV2-V2) > Tol)
+ SS = new Geom_RectangularTrimmedSurface(S, U1, U2, V1, V2);
+ SS->Bounds(surfU1,surfU2,surfV1,surfV2);
S = GeomConvert::SurfaceToBSplineSurface(SS);
Handle(Geom_BSplineSurface) BS = Handle(Geom_BSplineSurface)::DownCast(S) ;
Standard_Boolean isConvert2d = ((!C3d.IsNull() && !C3d->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) &&
!C3d->IsKind(STANDARD_TYPE(Geom_BezierCurve))) ||
IsConvert(E));
-
+
if(BRep_Tool::Degenerated(E)) {
//Curve2d = C2d;
if(!C2d->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
}
S->Bounds(Uinf, Usup, Vinf, Vsup);
- Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
+ //Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
u = (Usup - Uinf)*0.1;
v = (Vsup - Vinf)*0.1;
if(S->IsUPeriodic()) {
}
Standard_Real Uinf, Usup, Vinf, Vsup, u = 0, v = 0;
S->Bounds(Uinf, Usup, Vinf, Vsup);
- Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
+ //Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
u = (Usup - Uinf)*0.1;
v = (Vsup - Vinf)*0.1;
if(S->IsUPeriodic()) {
~ProjLib_PolarFunction() {}
Standard_Real FirstParameter() const
- {return (myCurve->FirstParameter()+1.e-9);}
+ {return (myCurve->FirstParameter()/*+1.e-9*/);}
Standard_Real LastParameter() const
- {return (myCurve->LastParameter()-1.e-9);}
+ {return (myCurve->LastParameter()/*-1.e-9*/);}
gp_Pnt2d Value(const Standard_Real t) const {
return Function_Value
Standard_Integer NbKnots = NbCurves + 1;
// The start and end nodes are not correct : Cf: opening of the interval
- Knots( 1) -= 1.e-9;
- Knots(NbKnots) += 1.e-9;
+ //Knots( 1) -= 1.e-9;
+ //Knots(NbKnots) += 1.e-9;
TColStd_Array1OfInteger Mults( 1, NbKnots);