ShapeBuild
OCCT package ShapeBuild: ShapeBuild, ShapeBuild_Edge, ShapeBuild_ReShape, ShapeBuild_Vertex.
ShapeBuild
This package provides basic building tools for other packages in ShapeHealing. These tools are rather internal for ShapeHealing .
Constructors(1)
Static methods(1)
Rebuilds a shape with substitution of some components Returns a
Geom_Surfacewhich is the Plane XOY (Z positive) This allows to consider an UV space homologous to a 3D space, with this support surface.
ShapeBuild_Edge
This class provides low-level operators for building an edge 3d curve, copying edge with replaced vertices etc.
Constructors(1)
Instance methods(19)
- CopyReplaceVertices(edge: TopoDS_Edge, V1: TopoDS_Vertex, V2: TopoDS_Vertex): TopoDS_Edge
Copy edge and replace one or both its vertices to a given one(s). Vertex V1 replaces FORWARD vertex, and V2 - REVERSED, as they are found by
TopoDS_Iterator. If V1 or V2 is NULL, the original vertex is taken.Parameters (3)edgeV1V2
- CopyRanges(toedge: TopoDS_Edge, fromedge: TopoDS_Edge, alpha?: number, beta?: number): void
Copies ranges for curve3d and all common pcurves from edge <fromedge> into edge <toedge>.
Parameters (4)toedgefromedgealphabeta
- SetRange3d(edge: TopoDS_Edge, first: number, last: number): void
Sets range on 3d curve only.
Parameters (3)edgefirstlast
- CopyPCurves(toedge: TopoDS_Edge, fromedge: TopoDS_Edge): void
Makes a copy of pcurves from edge <fromedge> into edge <toedge>. Pcurves which are already present in <toedge>, are replaced by copies, other are copied. Ranges are also copied.
Parameters (2)toedgefromedge
- Copy(edge: TopoDS_Edge, sharepcurves?: boolean): TopoDS_Edge
Make a copy of <edge> by call to
CopyReplaceVertices()(i.e. construct new TEdge with the same pcurves and vertices). If <sharepcurves> is False, pcurves are also replaced by their copies with help of method CopyPCurves.Parameters (2)edgesharepcurves
- RemovePCurve(edge: TopoDS_Edge, face: TopoDS_Face): void
Removes the PCurve(s) which could be recorded in an Edge for the given Face.
Parameters (2)edgeface
- RemovePCurve(edge: TopoDS_Edge, surf: Geom_Surface): void
Removes the PCurve(s) which could be recorded in an Edge for the given Surface.
Parameters (2)edgesurf
- RemovePCurve(edge: TopoDS_Edge, surf: Geom_Surface, loc: TopLoc_Location): void
Removes the PCurve(s) which could be recorded in an Edge for the given Surface, with given Location.
Parameters (3)edgesurfloc
- ReplacePCurve(edge: TopoDS_Edge, pcurve: Geom2d_Curve, face: TopoDS_Face): void
Replace the PCurve in an Edge for the given Face In case if edge is seam, i.e. has 2 pcurves on that face, only pcurve corresponding to the orientation of the edge is replaced.
Parameters (3)edgepcurveface
- ReassignPCurve(edge: TopoDS_Edge, old: TopoDS_Face, sub: TopoDS_Face): boolean
Reassign edge pcurve lying on face <old> to another face . If edge has two pcurves on <old> face, only one of them will be reassigned, and other will left alone. Similarly, if edge already had a pcurve on face , it will have two pcurves on it. Returns True if succeeded, False if no pcurve lying on <old> found.
Parameters (3)edgeoldsub
- TransformPCurve(pcurve: Geom2d_Curve, trans: gp_Trsf2d, uFact: number, aFirst: number, aLast: number): { returnValue: Geom2d_Curve; aFirst: number; aLast: number; [Symbol.dispose](): void }
Transforms the PCurve with given matrix and affinity U factor.
Parameters (5)pcurvetransuFactaFirstaLast
ReturnsA result object with fields:
returnValue: the C++ return valueaFirst: updated value from the call.aLast: updated value from the call.
Dispose the returned envelope to release owned Handle fields.
- RemoveCurve3d(edge: TopoDS_Edge): void
Removes the Curve3D recorded in an Edge.
Parameters (1)edge
- BuildCurve3d(edge: TopoDS_Edge): boolean
Calls BRepTools::BuildCurve3D.
Parameters (1)edge
- MakeEdge(edge: TopoDS_Edge, curve: Geom_Curve, L: TopLoc_Location): void
Makes edge with curve and location.
Parameters (3)edge—Mutated in place; read the updated value from this argument after the call.curveL
- MakeEdge(edge: TopoDS_Edge, pcurve: Geom2d_Curve, face: TopoDS_Face): void
Makes edge with pcurve and face.
Parameters (3)edge—Mutated in place; read the updated value from this argument after the call.pcurveface
- MakeEdge(edge: TopoDS_Edge, pcurve: Geom2d_Curve, S: Geom_Surface, L: TopLoc_Location): void
Makes edge with pcurve, surface and location.
Parameters (4)edge—Mutated in place; read the updated value from this argument after the call.pcurveSL
- MakeEdge(edge: TopoDS_Edge, curve: Geom_Curve, L: TopLoc_Location, p1: number, p2: number): void
Makes edge with curve, location and range [p1, p2].
Parameters (5)edge—Mutated in place; read the updated value from this argument after the call.curveLp1p2
- MakeEdge(edge: TopoDS_Edge, pcurve: Geom2d_Curve, face: TopoDS_Face, p1: number, p2: number): void
Makes edge with pcurve, face and range [p1, p2].
Parameters (5)edge—Mutated in place; read the updated value from this argument after the call.pcurvefacep1p2
- MakeEdge(edge: TopoDS_Edge, pcurve: Geom2d_Curve, S: Geom_Surface, L: TopLoc_Location, p1: number, p2: number): void
Makes edge with pcurve, surface, location and range [p1, p2].
Parameters (6)edge—Mutated in place; read the updated value from this argument after the call.pcurveSLp1p2
ShapeBuild_ReShape
Rebuilds a Shape by making pre-defined substitutions on some of its components.
In a first phase, it records requests to replace or remove some individual shapes For each shape, the last given request is recorded Requests may be applied "Oriented" (i.e. only to an item with the SAME orientation) or not (the orientation of replacing shape is respectful of that of the original one)
Then, these requests may be applied to any shape which may contain one or more of these individual shapes
Constructors(1)
Returns an empty Reshape.
Static methods(2)
- get_type_name(): string
Instance methods(5)
- Apply(shape: TopoDS_Shape, until: TopAbs_ShapeEnum, buildmode: number): TopoDS_Shape
Applies the substitutions requests to a shape.
<until> gives the level of type until which requests are taken into account. For subshapes of the type <until> no rebuild and further exploring are done. ACTUALLY, NOT IMPLEMENTED BELOW TopAbs_FACE
<buildmode> says how to do on a SOLID,SHELL ... if one of its sub-shapes has been changed: 0: at least one Replace or Remove -> COMPOUND, else as such 1: at least one Remove (Replace are ignored) -> COMPOUND 2: Replace and Remove are both ignored If Replace/Remove are ignored or absent, the result as same type as the starting shapeParameters (3)shapeuntilbuildmode
- Apply(theShape: TopoDS_Shape, theUntil: TopAbs_ShapeEnum): TopoDS_Shape
Applies the substitutions requests to a shape.
<until> gives the level of type until which requests are taken into account. For subshapes of the type <until> no rebuild and further exploring are done.
NOTE: each subshape can be replaced by shape of the same type or by shape containing only shapes of that type (for example,TopoDS_Edgecan be replaced byTopoDS_Edge,TopoDS_WireorTopoDS_Compoundcontaining TopoDS_Edges). If incompatible shape type is encountered, it is ignored and flag FAIL1 is set in Status.Parameters (2)theShapetheUntil
- Status(shape: TopoDS_Shape, newsh: TopoDS_Shape, last: boolean): number
Returns a complete substitution status for a shape 0 : not recorded, <newsh> = original <shape> < 0: to be removed, <newsh> is NULL.
0: to be replaced, <newsh> is a new item If <last> is False, returns status and new shape recorded in the map directly for the shape, if True and status > 0 then recursively searches for the last status and new shape.Parameters (3)shapenewsh—Mutated in place; read the updated value from this argument after the call.last
- Status(status: ShapeExtend_Status): boolean
Queries the status of last call to Apply(shape,enum) OK : no (sub)shapes replaced or removed DONE1: source (starting) shape replaced DONE2: source (starting) shape removed DONE3: some subshapes replaced DONE4: some subshapes removed FAIL1: some replacements not done because of bad type of subshape.
Parameters (1)status
ShapeBuild_Vertex
Provides low-level functions used for constructing vertices.
Constructors(1)
Instance methods(2)
- CombineVertex(V1: TopoDS_Vertex, V2: TopoDS_Vertex, tolFactor: number): TopoDS_Vertex
Combines new vertex from two others. This new one is the smallest vertex which comprises both of the source vertices. The function takes into account the positions and tolerances of the source vertices. The tolerance of the new vertex will be equal to the minimal tolerance that is required to comprise source vertices multiplied by tolFactor (in order to avoid errors because of discreteness of calculations).
Parameters (3)V1V2tolFactor
- CombineVertex(pnt1: gp_Pnt, pnt2: gp_Pnt, tol1: number, tol2: number, tolFactor: number): TopoDS_Vertex
The same function as above, except that it accepts two points and two tolerances instead of vertices.
Parameters (5)pnt1pnt2tol1tol2tolFactor
ShapeAnalysis
OCCT package ShapeAnalysis: ShapeAnalysis, ShapeAnalysis_BoxBndTreeSelector, ShapeAnalysis_CanonicalRecognition, ShapeAnalysis_CheckSmallFace, and 15 more…
ShapeConstruct
OCCT package ShapeConstruct: ShapeConstruct, ShapeConstruct_Curve, ShapeConstruct_MakeTriangulation, ShapeConstruct_ProjectCurveOnSurface.