OpenCascade.js
API ReferenceModelingAlgorithmsTKShHealing

ShapeConstruct

OCCT package ShapeConstruct: ShapeConstruct, ShapeConstruct_Curve, ShapeConstruct_MakeTriangulation, ShapeConstruct_ProjectCurveOnSurface.

ShapeConstruct

This package provides new algorithms for constructing new geometrical objects and topological shapes. It complements and extends algorithms available in Open CASCADE topological and geometrical toolkist. The functionality provided by this package are the following: projecting curves on surface, adjusting curve to have given start and end points. P.

Constructors(1)

Static methods(6)

  • ConvertCurveToBSpline(C3D: Geom_Curve, First: number, Last: number, Tol3d: number, Continuity: GeomAbs_Shape, MaxSegments: number, MaxDegree: number): Geom_BSplineCurve

    Tool for wire triangulation.

    Parameters (7)
    • C3D
    • First
    • Last
    • Tol3d
    • Continuity
    • MaxSegments
    • MaxDegree
  • ConvertCurveToBSpline(C2D: Geom2d_Curve, First: number, Last: number, Tol2d: number, Continuity: GeomAbs_Shape, MaxSegments: number, MaxDegree: number): Geom2d_BSplineCurve
    Parameters (7)
    • C2D
    • First
    • Last
    • Tol2d
    • Continuity
    • MaxSegments
    • MaxDegree
  • ConvertSurfaceToBSpline(surf: Geom_Surface, UF: number, UL: number, VF: number, VL: number, Tol3d: number, Continuity: GeomAbs_Shape, MaxSegments: number, MaxDegree: number): Geom_BSplineSurface
    Parameters (9)
    • surf
    • UF
    • UL
    • VF
    • VL
    • Tol3d
    • Continuity
    • MaxSegments
    • MaxDegree
  • join pcurves of the <theEdge> on the <theFace> try to use pcurves from originas edges <theEdges> Returns false if cannot join pcurves

    Parameters (3)
    • theEdges
    • theFace
    • theEdge
      Mutated in place; read the updated value from this argument after the call.
  • JoinCurves(c3d1: Geom_Curve, ac3d2: Geom_Curve, Orient1: TopAbs_Orientation, Orient2: TopAbs_Orientation, first1: number, last1: number, first2: number, last2: number, isRev1: boolean, isRev2: boolean): { returnValue: boolean; first1: number; last1: number; first2: number; last2: number; c3dOut: Geom_Curve; isRev1: boolean; isRev2: boolean; [Symbol.dispose](): void }

    Method for joininig curves 3D. Parameters : c3d1,ac3d2 - initial curves Orient1, Orient2 - initial edges orientations. first1,last1,first2,last2 - parameters for trimming curves (re-calculate with account of orientation edges) c3dOut - result curve isRev1,isRev2 - out parameters indicative on possible errors. Return value : True - if curves were joined successfully, else - False.

    Parameters (10)
    • c3d1
    • ac3d2
    • Orient1
    • Orient2
    • first1
    • last1
    • first2
    • last2
    • isRev1
    • isRev2
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • first1: updated value from the call.
    • last1: updated value from the call.
    • first2: updated value from the call.
    • last2: updated value from the call.
    • c3dOut: owned by the returned envelope.
    • isRev1: updated value from the call.
    • isRev2: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • JoinCurves(c2d1: Geom2d_Curve, ac2d2: Geom2d_Curve, Orient1: TopAbs_Orientation, Orient2: TopAbs_Orientation, first1: number, last1: number, first2: number, last2: number, isRev1: boolean, isRev2: boolean, isError: boolean): { returnValue: boolean; first1: number; last1: number; first2: number; last2: number; c2dOut: Geom2d_Curve; isRev1: boolean; isRev2: boolean; [Symbol.dispose](): void }

    Method for joininig curves 3D. Parameters : c3d1,ac3d2 - initial curves Orient1, Orient2 - initial edges orientations. first1,last1,first2,last2 - parameters for trimming curves (re-calculate with account of orientation edges) c3dOut - result curve isRev1,isRev2 - out parameters indicative on possible errors. isError - input parameter indicative possible errors due to that one from edges have one vertex Return value : True - if curves were joined successfully, else - False.

    Parameters (11)
    • c2d1
    • ac2d2
    • Orient1
    • Orient2
    • first1
    • last1
    • first2
    • last2
    • isRev1
    • isRev2
    • isError
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • first1: updated value from the call.
    • last1: updated value from the call.
    • first2: updated value from the call.
    • last2: updated value from the call.
    • c2dOut: owned by the returned envelope.
    • isRev1: updated value from the call.
    • isRev2: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.

ShapeConstruct_Curve

Adjusts curve to have start and end points at the given points (currently works on lines and B-Splines only).

Constructors(1)

Static methods(2)

Instance methods(5)

  • AdjustCurve(C3D: Geom_Curve, P1: gp_Pnt, P2: gp_Pnt, take1?: boolean, take2?: boolean): boolean

    Modifies a curve in order to make its bounds confused with given points. Works only on lines and B-Splines, returns True in this case, else returns False. For line considers both bounding points, for B-Splines only specified.
    Warning : Does not check if curve should be reversed

    Parameters (5)
    • C3D
    • P1
    • P2
    • take1
    • take2
  • AdjustCurveSegment(C3D: Geom_Curve, P1: gp_Pnt, P2: gp_Pnt, U1: number, U2: number): boolean

    Modifies a curve in order to make its bounds confused with given points. Works only on lines and B-Splines.
    For lines works as previous method, B-Splines are segmented at the given values and then are adjusted to the points.

    Parameters (5)
    • C3D
    • P1
    • P2
    • U1
    • U2
  • AdjustCurve2d(C2D: Geom2d_Curve, P1: gp_Pnt2d, P2: gp_Pnt2d, take1?: boolean, take2?: boolean): boolean

    Modifies a curve in order to make its bounds confused with given points. Works only on lines and B-Splines, returns True in this case, else returns False.
    For line considers both bounding points, for B-Splines only specified.
    Warning : Does not check if curve should be reversed

    Parameters (5)
    • C2D
    • P1
    • P2
    • take1
    • take2
  • ConvertToBSpline(C: Geom_Curve, first: number, last: number, prec: number): Geom_BSplineCurve

    Converts a curve of any type (only part from first to last) to bspline. The method of conversion depends on the type of original curve: BSpline -> C.Segment(first,last) Bezier and Line -> GeomConvert::CurveToBSplineCurve(C).Segment(first,last) Conic and Other -> Approx_Curve3d(C[first,last],prec,C1,9,1000).

    Parameters (4)
    • C
    • first
    • last
    • prec
  • ConvertToBSpline(C: Geom2d_Curve, first: number, last: number, prec: number): Geom2d_BSplineCurve

    Converts a curve of any type (only part from first to last) to bspline. The method of conversion depends on the type of original curve: BSpline -> C.Segment(first,last) Bezier and Line -> GeomConvert::CurveToBSplineCurve(C).Segment(first,last) Conic and Other -> Approx_Curve2d(C[first,last],prec,C1,9,1000).

    Parameters (4)
    • C
    • first
    • last
    • prec

ShapeConstruct_ProjectCurveOnSurface

This tool provides a method for computing pcurve by projecting 3d curve onto a surface. Projection is done by 23 or more points (this number is changed for B-Splines according to the following rule: the total number of the points is not less than number of spans * (degree + 1); it is increased recursively starting with 23 and is added with 22 until the condition is fulfilled). Isoparametric cases (if curve corresponds to U=const or V=const on the surface) are recognized with the given precision.

Constructors(1)

Static methods(2)

Instance methods(9)

  • Init(theSurf: Geom_Surface, thePreci: number): void

    Initializes the object with all necessary parameters, i.e. surface and precision.

    Parameters (2)
    • theSurf
      the surface to project on
    • thePreci
      the precision for projection
  • Init(theSurf: ShapeAnalysis_Surface, thePreci: number): void

    Initializes the object with all necessary parameters, i.e. surface and precision.

    Parameters (2)
  • SetSurface(theSurf: Geom_Surface): void

    Loads a surface (in the form of Geom_Surface) to project on.

    Parameters (1)
    • theSurf
      the surface to project on
  • Loads a surface (in the form of ShapeAnalysis_Surface) to project on.

    Parameters (1)
    • theSurf
      the surface to project on
  • SetPrecision(thePreci: number): void

    Sets value for current precision.

    Parameters (1)
    • thePreci
      the precision value
  • Returns (modifiable) the flag specifying to which side of parametrical space adjust part of pcurve which lies on seam. This is required in very rare case when 3d curve which is to be projected goes partly along the seam on the closed surface with singularity (e.g. sphere), goes through the degenerated point and partly lies on internal area of surface.
    If this flag is True, the seam part of such curve will be adjusted to the left side of parametric space (on sphere U=0), else to the right side (on sphere U=2*PI) Default value is True

    Returns

    modifiable reference to the adjustment flag

  • Status(theStatus: ShapeExtend_Status): boolean

    Returns the status of last Perform.

    Parameters (1)
    • theStatus
      the status to query
    Returns

    true if the specified status is set

  • Perform(theC3D: Geom_Curve, theFirst: number, theLast: number, theTolFirst: number, theTolLast: number): { returnValue: boolean; theC2D: Geom2d_Curve; [Symbol.dispose](): void }

    Computes the projection of 3d curve onto a surface using the specialized algorithm. Returns False if projector fails, otherwise, if pcurve computed successfully, returns True. The output curve 2D is guaranteed to be same-parameter with input curve 3D on the interval [theFirst, theLast]. If the output curve lies on a direct line the infinite line is returned, in the case same-parameter condition is satisfied.

    Parameters (5)
    • theC3D
      the 3D curve to project
    • theFirst
      the first parameter of the curve
    • theLast
      the last parameter of the curve
    • theTolFirst
      the tolerance at the first point (default: Precision::Confusion())
    • theTolLast
      the tolerance at the last point (default: Precision::Confusion())
    Returns

    A result object with fields:

    • returnValue: true if projection succeeded
    • theC2D: the resulting 2D curve, owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.