OpenCascade.js
API ReferenceModelingAlgorithmsTKShHealing

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_Surface which 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)

  • 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)
    • edge
    • V1
    • V2
  • 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)
    • toedge
    • fromedge
    • alpha
    • beta
  • SetRange3d(edge: TopoDS_Edge, first: number, last: number): void

    Sets range on 3d curve only.

    Parameters (3)
    • edge
    • first
    • last
  • 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)
    • toedge
    • fromedge
  • 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)
    • edge
    • sharepcurves
  • Removes the PCurve(s) which could be recorded in an Edge for the given Face.

    Parameters (2)
    • edge
    • face
  • Removes the PCurve(s) which could be recorded in an Edge for the given Surface.

    Parameters (2)
    • edge
    • surf
  • Removes the PCurve(s) which could be recorded in an Edge for the given Surface, with given Location.

    Parameters (3)
    • edge
    • surf
    • loc
  • 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)
    • edge
    • pcurve
    • face
  • 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)
    • edge
    • old
    • sub
  • 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)
    • pcurve
    • trans
    • uFact
    • aFirst
    • aLast
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • aFirst: updated value from the call.
    • aLast: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • Removes the Curve3D recorded in an Edge.

    Parameters (1)
    • edge
  • BuildCurve3d(edge: TopoDS_Edge): boolean

    Calls BRepTools::BuildCurve3D.

    Parameters (1)
    • edge
  • Makes edge with curve and location.

    Parameters (3)
    • edge
      Mutated in place; read the updated value from this argument after the call.
    • curve
    • L
  • 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.
    • pcurve
    • face
  • Makes edge with pcurve, surface and location.

    Parameters (4)
    • edge
      Mutated in place; read the updated value from this argument after the call.
    • pcurve
    • S
    • L
  • 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.
    • curve
    • L
    • p1
    • p2
  • 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.
    • pcurve
    • face
    • p1
    • p2
  • 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.
    • pcurve
    • S
    • L
    • p1
    • p2

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)

Static methods(2)

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 shape

    Parameters (3)
    • shape
    • until
    • buildmode
  • 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_Edge can be replaced by TopoDS_Edge, TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges). If incompatible shape type is encountered, it is ignored and flag FAIL1 is set in Status.

    Parameters (2)
    • theShape
    • theUntil
  • 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)
    • shape
    • newsh
      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)

  • 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)
    • V1
    • V2
    • tolFactor
  • 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)
    • pnt1
    • pnt2
    • tol1
    • tol2
    • tolFactor