ShapeAnalysis
OCCT package ShapeAnalysis: ShapeAnalysis, ShapeAnalysis_BoxBndTreeSelector, ShapeAnalysis_CanonicalRecognition, ShapeAnalysis_CheckSmallFace, and 15 more…
ShapeAnalysis
This package is intended to analyze geometrical objects and topological shapes. Analysis domain includes both exploring geometrical and topological properties of shapes and checking their conformance to Open CASCADE requirements.
The directions of analysis provided by tools of this package are: computing quantities of subshapes, computing parameters of points on curve and surface, computing surface singularities, checking edge and wire consistency, checking edges order in the wire, checking face bounds orientation, checking small faces, analyzing shape tolerances, analyzing of free bounds of the shape.
Constructors(1)
Static methods(8)
- OuterWire(theFace: TopoDS_Face): TopoDS_Wire
Returns positively oriented wire in the face. If there is no such wire - returns the last wire of the face.
Parameters (1)theFace
- TotCross2D(sewd: ShapeExtend_WireData, aFace: TopoDS_Face): number
Returns a total area of 2d wire.
Parameters (2)sewdaFace
- ContourArea(theWire: TopoDS_Wire): number
Returns a total area of 3d wire.
Parameters (1)theWire
- IsOuterBound(face: TopoDS_Face): boolean
Returns True if <F> has outer bound.
Parameters (1)face
- AdjustByPeriod(Val: number, ToVal: number, Period: number): number
Returns a shift required to move point <Val> to the range [ToVal-Period/2,ToVal+Period/2]. This shift will be the divisible by Period. Intended for adjusting parameters on periodic surfaces.
Parameters (3)ValToValPeriod
- AdjustToPeriod(Val: number, ValMin: number, ValMax: number): number
Returns a shift required to move point <Val> to the range [ValMin,ValMax]. This shift will be the divisible by Period with Period = ValMax - ValMin. Intended for adjusting parameters on periodic surfaces.
Parameters (3)ValValMinValMax
- FindBounds(shape: TopoDS_Shape, V1: TopoDS_Vertex, V2: TopoDS_Vertex): void
Finds the start and end vertices of the shape Shape can be of the following type: vertex: V1 and V2 are the same and equal to <shape>, edge : V1 is start and V2 is end vertex (see
ShapeAnalysis_Edgemethods FirstVertex and LastVertex), wire : V1 is start vertex of the first edge, V2 is end vertex of the last edge (also seeShapeAnalysis_Edge). If wire contains no edges V1 and V2 are nullified If none of the above V1 and V2 are nullified.Parameters (3)shapeV1—Mutated in place; read the updated value from this argument after the call.V2—Mutated in place; read the updated value from this argument after the call.
- GetFaceUVBounds(F: TopoDS_Face, Umin: number, Umax: number, Vmin: number, Vmax: number): { Umin: number; Umax: number; Vmin: number; Vmax: number }
Computes exact UV bounds of all wires on the face.
Parameters (5)FUminUmaxVminVmax
ReturnsA result object with fields:
Umin: updated value from the call.Umax: updated value from the call.Vmin: updated value from the call.Vmax: updated value from the call.
ShapeAnalysis_BoxBndTreeSelector
Constructors(1)
- constructor(theSeq: NCollection_HArray1_TopoDS_Shape, theShared: boolean): ShapeAnalysis_BoxBndTreeSelectorParameters (2)
theSeqtheShared
Instance methods(12)
- DefineBoxes(theFBox: Bnd_Box, theLBox: Bnd_Box): voidParameters (2)
theFBoxtheLBox
- DefineVertexes(theVf: TopoDS_Vertex, theVl: TopoDS_Vertex): voidParameters (2)
theVftheVl
- Parameters (2)
theFPnttheLPnt
- GetNb(): number
- SetNb(theNb: number): voidParameters (1)
theNb
- LoadList(elem: number): voidParameters (1)
elem
- SetStop(): void
- SetTolerance(theTol: number): voidParameters (1)
theTol
- ContWire(nbWire: number): booleanParameters (1)
nbWire
- LastCheckStatus(theStatus: ShapeExtend_Status): booleanParameters (1)
theStatus
- Parameters (1)
argNo0
- Accept(argNo0: number): booleanParameters (1)
argNo0
ShapeAnalysis_CanonicalRecognition
This class provides operators for analysis surfaces and curves of shapes in order to find out more simple geometry entities, which could replace existing complex (for example, BSpline) geometry objects with given tolerance.
Constructors(2)
Empty constructor.
constructor with shape initialisation
Parameters (1)theShape
Instance methods(12)
- SetShape(theShape: TopoDS_Shape): void
Sets shape.
Parameters (1)theShape
Returns input shape.
- GetGap(): number
Returns deviation between input geometry entity and analytical entity.
- GetStatus(): number
Returns status of operation. Current meaning of possible values of status: -1 - algorithm is not initalazed by shape 0 - no errors 1 - error during any operation (usually - because of wrong input data) Any operation (calling any methods like IsPlane(...), ...) can be performed when current staue is equal 0. If after any operation status != 0, it is necessary to set it 0 by method
ClearStatus()before calling other operation. - ClearStatus(): void
Returns status to be equal 0.
Returns true if the underlined surface can be represent by plane with tolerance theTol and sets in thePln the result plane.
Parameters (2)theTolthePln—Mutated in place; read the updated value from this argument after the call.
- IsCylinder(theTol: number, theCyl: gp_Cylinder): boolean
Returns true if the underlined surface can be represent by cylindrical one with tolerance theTol and sets in theCyl the result cylinrical surface.
Parameters (2)theToltheCyl—Mutated in place; read the updated value from this argument after the call.
Returns true if the underlined surface can be represent by conical one with tolerance theTol and sets in theCone the result conical surface.
Parameters (2)theToltheCone—Mutated in place; read the updated value from this argument after the call.
Returns true if the underlined surface can be represent by spherical one with tolerance theTol and sets in theSphere the result spherical surface.
Parameters (2)theToltheSphere—Mutated in place; read the updated value from this argument after the call.
Returns true if the underlined curve can be represent by line with tolerance theTol and sets in theLin the result line.
Parameters (2)theToltheLin—Mutated in place; read the updated value from this argument after the call.
Returns true if the underlined curve can be represent by circle with tolerance theTol and sets in theCirc the result circle.
Parameters (2)theToltheCirc—Mutated in place; read the updated value from this argument after the call.
Returns true if the underlined curve can be represent by ellipse with tolerance theTol and sets in theCirc the result ellipse.
Parameters (2)theToltheElips—Mutated in place; read the updated value from this argument after the call.
ShapeAnalysis_CheckSmallFace
Analysis of the face size.
Constructors(1)
Creates an empty tool Checks a Shape i.e. each of its faces, records checks as diagnostics in the <infos>.
If <infos> has not been set before, no check is done
For faces which are in a Shell, topological data are recorded to allow recovering connectivities after fixing or removing the small faces or parts of faces Enchains various checks on a face inshell : to compute more information, relevant to topology
Instance methods(22)
- IsSpotFace(F: TopoDS_Face, spot: gp_Pnt, spotol: number, tol: number): { returnValue: number; spotol: number }
Checks if a Face is as a Spot Returns 0 if not, 1 if yes, 2 if yes and all vertices are the same By default, considers the tolerance zone of its vertices A given value <tol> may be given to check a spot of this size If a Face is a Spot, its location is returned in <spot>, and <spotol> returns an equivalent tolerance, which is computed as half of max dimension of min-max box of the face.
Parameters (4)Fspot—Mutated in place; read the updated value from this argument after the call.spotoltol
ReturnsA result object with fields:
returnValue: the C++ return valuespotol: updated value from the call.
- CheckSpotFace(F: TopoDS_Face, tol?: number): boolean
Acts as IsSpotFace, but records in <infos> a diagnostic "SpotFace" with the Pnt as value (data "Location").
Parameters (2)Ftol
- IsStripSupport(F: TopoDS_Face, tol?: number): boolean
Checks if a Face lies on a Surface which is a strip So the Face is a strip. But a Face may be a strip elsewhere ..
A given value <tol> may be given to check max width By default, considers the tolerance zone of its edges Returns 0 if not a strip support, 1 strip in U, 2 strip in VParameters (2)Ftol
- CheckStripEdges(E1: TopoDS_Edge, E2: TopoDS_Edge, tol: number, dmax: number): { returnValue: boolean; dmax: number }
Checks if two edges define a strip, i.e. distance maxi below tolerance, given or some of those of E1 and E2.
Parameters (4)E1E2toldmax
ReturnsA result object with fields:
returnValue: the C++ return valuedmax: updated value from the call.
- FindStripEdges(F: TopoDS_Face, E1: TopoDS_Edge, E2: TopoDS_Edge, tol: number, dmax: number): { returnValue: boolean; dmax: number }
Searches for two and only two edges up tolerance Returns True if OK, false if not 2 edges If True, returns the two edges and their maximum distance.
Parameters (5)FE1—Mutated in place; read the updated value from this argument after the call.E2—Mutated in place; read the updated value from this argument after the call.toldmax
ReturnsA result object with fields:
returnValue: the C++ return valuedmax: updated value from the call.
- CheckSingleStrip(F: TopoDS_Face, E1: TopoDS_Edge, E2: TopoDS_Edge, tol: number): boolean
Checks if a Face is a single strip, i.e. brings two great edges which are confused on their whole length, possible other edges are small or null length.
Returns 0 if not a strip support, 1 strip in U, 2 strip in V Records diagnostic in info if it is a single stripParameters (4)FE1—Mutated in place; read the updated value from this argument after the call.E2—Mutated in place; read the updated value from this argument after the call.tol
- CheckStripFace(F: TopoDS_Face, E1: TopoDS_Edge, E2: TopoDS_Edge, tol: number): boolean
Checks if a Face is as a Strip Returns 0 if not or non determined, 1 if in U, 2 if in V By default, considers the tolerance zone of its edges A given value <tol> may be given to check a strip of max this width.
If a Face is determined as a Strip, it is delinited by two lists of edges. These lists are recorded in diagnostic Diagnostic "StripFace" brings data "Direction" (U or V), "List1" , "List2" (if they could be computed)Parameters (4)FE1—Mutated in place; read the updated value from this argument after the call.E2—Mutated in place; read the updated value from this argument after the call.tol
- CheckSplittingVertices(F: TopoDS_Face, MapEdges: NCollection_DataMap_TopoDS_Shape_NCollection_List_TopoDS_Shape_TopTools_ShapeMapHasher, MapParam: NCollection_DataMap_TopoDS_Shape_NCollection_List_double_TopTools_ShapeMapHasher, theAllVert: TopoDS_Compound): number
Checks if a Face brings vertices which split it, either confused with non adjacent vertices, or confused with their projection on non adjacent edges Returns the count of found splitting vertices Each vertex then brings a diagnostic "SplittingVertex", with data : "Face" for the face, "Edge" for the split edge.
Parameters (4)FMapEdges—Mutated in place; read the updated value from this argument after the call.MapParam—Mutated in place; read the updated value from this argument after the call.theAllVert—Mutated in place; read the updated value from this argument after the call.
- CheckPin(F: TopoDS_Face, whatrow: number, sence: number): { returnValue: boolean; whatrow: number; sence: number }
Checks if a Face has a pin, which can be edited No singularity : no pin, returns 0 If there is a pin, checked topics, with returned value :
- 0 : nothing to do more
- 1 : "smooth", i.e. not a really sharp pin -> diagnostic "SmoothPin"
- 2 : stretched pin, i.e. is possible to relimit the face by another vertex, so that this vertex still gives a pin -> diagnostic "StretchedPin" with location of vertex (Pnt)
Parameters (3)Fwhatrowsence
ReturnsA result object with fields:
returnValue: the C++ return valuewhatrow: updated value from the call.sence: updated value from the call.
- CheckTwisted(F: TopoDS_Face, paramu: number, paramv: number): { returnValue: boolean; paramu: number; paramv: number }
Checks if a Face is twisted (apart from checking Pin, i.e. it does not give information on pin, only "it is twisted").
Parameters (3)Fparamuparamv
ReturnsA result object with fields:
returnValue: the C++ return valueparamu: updated value from the call.paramv: updated value from the call.
- CheckPinFace(F: TopoDS_Face, mapEdges: NCollection_DataMap_TopoDS_Shape_TopoDS_Shape_TopTools_ShapeMapHasher, toler: number): booleanParameters (3)
FmapEdgestoler
- CheckPinEdges(theFirstEdge: TopoDS_Edge, theSecondEdge: TopoDS_Edge, coef1: number, coef2: number, toler: number): booleanParameters (5)
theFirstEdgetheSecondEdgecoef1coef2toler
- Status(status: ShapeExtend_Status): boolean
Returns the status of last call to Perform() ShapeExtend_OK : face was OK, nothing done ShapeExtend_DONE1: some wires are fixed ShapeExtend_DONE2: orientation of wires fixed ShapeExtend_DONE3: missing seam added ShapeExtend_DONE4: small area wire removed ShapeExtend_DONE5: natural bounds added ShapeExtend_FAIL1: some fails during fixing wires ShapeExtend_FAIL2: cannot fix orientation of wires ShapeExtend_FAIL3: cannot add missing seam ShapeExtend_FAIL4: cannot remove small area wire.
Parameters (1)status
- SetTolerance(tol: number): void
Sets a fixed Tolerance to check small face By default, local tolerance zone is considered Sets a fixed MaxTolerance to check small face Sets a fixed Tolerance to check small face By default, local tolerance zone is considered Unset fixed tolerance, comes back to local tolerance zones Unset fixed tolerance, comes back to local tolerance zones.
Parameters (1)tol
- Tolerance(): number
Returns the tolerance to check small faces, negative value if local tolerances zones are to be considered.
- StatusSpot(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusStrip(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusPin(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusTwisted(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusSplitVert(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusPinFace(status: ShapeExtend_Status): booleanParameters (1)
status
- StatusPinEdges(status: ShapeExtend_Status): booleanParameters (1)
status
ShapeAnalysis_Curve
Analyzing tool for 2d or 3d curve. Computes parameters of projected point onto a curve.
Constructors(1)
Static methods(7)
- IsPlanar(pnts: NCollection_Array1_gp_Pnt, Normal: gp_XYZ, preci: number): boolean
Checks if points are planar with given preci. If Normal has not zero modulus, checks with given normal.
Parameters (3)pntsNormal—Mutated in place; read the updated value from this argument after the call.preci
- IsPlanar(curve: Geom_Curve, Normal: gp_XYZ, preci: number): boolean
Checks if curve is planar with given preci. If Normal has not zero modulus, checks with given normal.
Parameters (3)curveNormal—Mutated in place; read the updated value from this argument after the call.preci
- GetSamplePoints(curve: Geom2d_Curve, first: number, last: number, seq: NCollection_Sequence_gp_Pnt2d): boolean
Returns sample points which will serve as linearisation of the2d curve in range (first, last) The distribution of sample points is consystent with what is used by
BRepTopAdaptor_FClass2d.Parameters (4)curvefirstlastseq—Mutated in place; read the updated value from this argument after the call.
- GetSamplePoints(curve: Geom_Curve, first: number, last: number, seq: NCollection_Sequence_gp_Pnt): boolean
Returns sample points which will serve as linearisation of the curve in range (first, last).
Parameters (4)curvefirstlastseq—Mutated in place; read the updated value from this argument after the call.
- IsClosed(curve: Geom_Curve, preci?: number): boolean
Tells if the Curve is closed with given precision. If <preci> < 0 then
Precision::Confusionis used.Parameters (2)curvepreci
- IsPeriodic(curve: Geom_Curve): boolean
This method was implemented as fix for changes in trimmed curve behaviour. For the moment trimmed curve returns false anyway. So it is necessary to adapt all Data exchange tools for this behaviour. Current implementation takes into account that curve may be offset.
Parameters (1)curve
- IsPeriodic(curve: Geom2d_Curve): boolean
The same as for Curve3d.
Parameters (1)curve
Instance methods(9)
- Project(C3D: Geom_Curve, P3D: gp_Pnt, preci: number, proj: gp_Pnt, param: number, AdjustToEnds: boolean): { returnValue: number; param: number }
Projects a Point on a Curve. Computes the projected point and its parameter on the curve. <preci> is used as 3d precision (hence, 0 will produce reject unless exact confusion). The number of iterations is limited. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>.
Returned value is the distance between the given point and computed one.Parameters (6)C3DP3Dpreciproj—Mutated in place; read the updated value from this argument after the call.paramAdjustToEnds
ReturnsA result object with fields:
returnValue: the C++ return valueparam: updated value from the call.
- Project(C3D: Adaptor3d_Curve, P3D: gp_Pnt, preci: number, proj: gp_Pnt, param: number, AdjustToEnds: boolean): { returnValue: number; param: number }
Projects a Point on a Curve. Computes the projected point and its parameter on the curve. <preci> is used as 3d precision (hence, 0 will produce reject unless exact confusion). The number of iterations is limited.
Returned value is the distance between the given point and computed one.Parameters (6)C3DP3Dpreciproj—Mutated in place; read the updated value from this argument after the call.paramAdjustToEnds
ReturnsA result object with fields:
returnValue: the C++ return valueparam: updated value from the call.
- Project(C3D: Geom_Curve, P3D: gp_Pnt, preci: number, proj: gp_Pnt, param: number, cf: number, cl: number, AdjustToEnds: boolean): { returnValue: number; param: number }
Projects a Point on a Curve, but parameters are limited between <cf> and <cl>. The range [cf, cl] is extended with help of Adaptor3d on the basis of 3d precision <preci>. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>.
Parameters (8)C3DP3Dpreciproj—Mutated in place; read the updated value from this argument after the call.paramcfclAdjustToEnds
ReturnsA result object with fields:
returnValue: the C++ return valueparam: updated value from the call.
- ProjectAct(C3D: Adaptor3d_Curve, P3D: gp_Pnt, preci: number, proj: gp_Pnt, param: number): { returnValue: number; param: number }Parameters (5)
C3DP3Dpreciprojparam
- NextProject(paramPrev: number, C3D: Geom_Curve, P3D: gp_Pnt, preci: number, proj: gp_Pnt, param: number, cf: number, cl: number, AdjustToEnds: boolean): { returnValue: number; param: number }
Projects a Point on a Curve using Newton method. <paramPrev> is taken as the first approximation of solution. If Newton algorithm fails the method
Project()is used. If AdjustToEnds is True, point will be adjusted to the end of the curve if distance is less than <preci>.Parameters (9)paramPrevC3DP3Dpreciproj—Mutated in place; read the updated value from this argument after the call.paramcfclAdjustToEnds
ReturnsA result object with fields:
returnValue: the C++ return valueparam: updated value from the call.
- NextProject(paramPrev: number, C3D: Adaptor3d_Curve, P3D: gp_Pnt, preci: number, proj: gp_Pnt, param: number): { returnValue: number; param: number }
Projects a Point on a Curve using Newton method. <paramPrev> is taken as the first approximation of solution. If Newton algorithm fails the method
Project()is used.Parameters (6)paramPrevC3DP3Dpreciproj—Mutated in place; read the updated value from this argument after the call.param
ReturnsA result object with fields:
returnValue: the C++ return valueparam: updated value from the call.
- ValidateRange(Crv: Geom_Curve, First: number, Last: number, prec: number): { returnValue: boolean; First: number; Last: number }
Validate parameters First and Last for the given curve in order to make them valid for creation of edge. This includes:
- limiting range [First,Last] by range of curve
- adjusting range [First,Last] for periodic (or closed) curve if Last < First Returns True if parameters are OK or are successfully corrected, or False if parameters cannot be corrected. In the latter case, parameters are reset to range of curve.
Parameters (4)CrvFirstLastprec
ReturnsA result object with fields:
returnValue: the C++ return valueFirst: updated value from the call.Last: updated value from the call.
- FillBndBox(C2d: Geom2d_Curve, First: number, Last: number, NPoints: number, Exact: boolean, Box: Bnd_Box2d): void
Computes a boundary box on segment of curve C2d from First to Last. This is done by taking NPoints points from the curve and, if Exact is True, by searching for exact extrema. All these points are added to Box.
Parameters (6)C2dFirstLastNPointsExactBox—Mutated in place; read the updated value from this argument after the call.
- SelectForwardSeam(C1: Geom2d_Curve, C2: Geom2d_Curve): number
Defines which pcurve (C1 or C2) should be chosen for FORWARD seam edge.
Parameters (2)C1C2
ShapeAnalysis_Edge
Tool for analyzing the edge. Queries geometrical representations of the edge (3d curve, pcurve on the given face or surface) and topological sub-shapes (bounding vertices). Provides methods for analyzing geometry and topology consistency (3d and pcurve(s) consistency, their adjacency to the vertices).
Constructors(1)
Empty constructor; initialises Status to OK.
Instance methods(27)
- HasCurve3d(edge: TopoDS_Edge): boolean
Tells if the edge has a 3d curve.
Parameters (1)edge
- Curve3d(edge: TopoDS_Edge, cf: number, cl: number, orient: boolean): { returnValue: boolean; C3d: Geom_Curve; cf: number; cl: number; [Symbol.dispose](): void }
Returns the 3d curve and bounding parameters for the edge Returns False if no 3d curve. If <orient> is True (default), takes orientation into account: if the edge is reversed, cf and cl are toggled.
Parameters (4)edgecfclorient
ReturnsA result object with fields:
returnValue: the C++ return valueC3d: owned by the returned envelope.cf: updated value from the call.cl: updated value from the call.
Dispose the returned envelope to release owned Handle fields.
- IsClosed3d(edge: TopoDS_Edge): boolean
Gives True if the edge has a 3d curve, this curve is closed, and the edge has the same vertex at start and end.
Parameters (1)edge
- HasPCurve(edge: TopoDS_Edge, face: TopoDS_Face): boolean
Tells if the Edge has a pcurve on the face.
Parameters (2)edgeface
- HasPCurve(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location): boolean
Tells if the edge has a pcurve on the surface (with location).
Parameters (3)edgesurfacelocation
- PCurve(edge: TopoDS_Edge, face: TopoDS_Face, cf: number, cl: number, orient: boolean): { returnValue: boolean; C2d: Geom2d_Curve; cf: number; cl: number; [Symbol.dispose](): void }Parameters (5)
edgefacecfclorient
- PCurve(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location, cf: number, cl: number, orient: boolean): { returnValue: boolean; C2d: Geom2d_Curve; cf: number; cl: number; [Symbol.dispose](): void }
Returns the pcurve and bounding parameters for the edge lying on the surface. Returns False if the edge has no pcurve on this surface. If <orient> is True (default), takes orientation into account: if the edge is reversed, cf and cl are toggled.
Parameters (6)edgesurfacelocationcfclorient
ReturnsA result object with fields:
returnValue: the C++ return valueC2d: owned by the returned envelope.cf: updated value from the call.cl: updated value from the call.
Dispose the returned envelope to release owned Handle fields.
- BoundUV(edge: TopoDS_Edge, face: TopoDS_Face, first: gp_Pnt2d, last: gp_Pnt2d): booleanParameters (4)
edgefacefirstlast
- BoundUV(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location, first: gp_Pnt2d, last: gp_Pnt2d): boolean
Returns the ends of pcurve Calls method PCurve with <orient> equal to True.
Parameters (5)edgesurfacelocationfirst—Mutated in place; read the updated value from this argument after the call.last—Mutated in place; read the updated value from this argument after the call.
- IsSeam(edge: TopoDS_Edge, face: TopoDS_Face): booleanParameters (2)
edgeface
- IsSeam(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location): boolean
Returns True if the edge has two pcurves on one surface.
Parameters (3)edgesurfacelocation
- FirstVertex(edge: TopoDS_Edge): TopoDS_Vertex
Returns start vertex of the edge (taking edge orientation into account).
Parameters (1)edge
- LastVertex(edge: TopoDS_Edge): TopoDS_Vertex
Returns end vertex of the edge (taking edge orientation into account).
Parameters (1)edge
- GetEndTangent2d(edge: TopoDS_Edge, face: TopoDS_Face, atEnd: boolean, pos: gp_Pnt2d, tang: gp_Vec2d, dparam: number): booleanParameters (6)
edgefaceatEndpostangdparam
- GetEndTangent2d(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location, atEnd: boolean, pos: gp_Pnt2d, tang: gp_Vec2d, dparam: number): boolean
Returns tangent of the edge pcurve at its start (if atEnd is False) or end (if True), regarding the orientation of edge. If edge is REVERSED, tangent is reversed before return. Returns True if pcurve is available and tangent is computed and is not null, else False.
Parameters (7)edgesurfacelocationatEndpos—Mutated in place; read the updated value from this argument after the call.tang—Mutated in place; read the updated value from this argument after the call.dparam
- CheckVerticesWithCurve3d(edge: TopoDS_Edge, preci?: number, vtx?: number): boolean
Checks the start and/or end vertex of the edge for matching with 3d curve with the given precision. <vtx> = 1 : start vertex only <vtx> = 2 : end vertex only <vtx> = 0 : both (default) If preci < 0 the vertices are considered with their own tolerances, else with the given <preci>.
Parameters (3)edgeprecivtx
- CheckVerticesWithPCurve(edge: TopoDS_Edge, face: TopoDS_Face, preci: number, vtx: number): booleanParameters (4)
edgefaceprecivtx
- CheckVerticesWithPCurve(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location, preci: number, vtx: number): boolean
Checks the start and/or end vertex of the edge for matching with pcurve with the given precision. <vtx> = 1 : start vertex <vtx> = 2 : end vertex <vtx> = 0 : both If preci < 0 the vertices are considered with their own tolerances, else with the given <preci>.
Parameters (5)edgesurfacelocationprecivtx
- CheckVertexTolerance(edge: TopoDS_Edge, face: TopoDS_Face, toler1: number, toler2: number): { returnValue: boolean; toler1: number; toler2: number }Parameters (4)
edgefacetoler1toler2
- CheckVertexTolerance(edge: TopoDS_Edge, toler1: number, toler2: number): { returnValue: boolean; toler1: number; toler2: number }
Checks if it is necessary to increase tolerances of the edge vertices to comprise the ends of 3d curve and pcurve on the given face (first method) or all pcurves stored in an edge (second one) toler1 returns necessary tolerance for first vertex, toler2 returns necessary tolerance for last vertex.
Parameters (3)edgetoler1toler2
ReturnsA result object with fields:
returnValue: the C++ return valuetoler1: updated value from the call.toler2: updated value from the call.
- CheckCurve3dWithPCurve(edge: TopoDS_Edge, face: TopoDS_Face): booleanParameters (2)
edgeface
- CheckCurve3dWithPCurve(edge: TopoDS_Edge, surface: Geom_Surface, location: TopLoc_Location): boolean
Checks mutual orientation of 3d curve and pcurve on the analysis of curves bounding points.
Parameters (3)edgesurfacelocation
- Status(status: ShapeExtend_Status): boolean
Returns the status (in the form of True/False) of last Check.
Parameters (1)status
- CheckSameParameter(edge: TopoDS_Edge, maxdev: number, NbControl: number): { returnValue: boolean; maxdev: number }
Checks the edge to be SameParameter. Calculates the maximal deviation between 3d curve and each pcurve of the edge on <NbControl> equidistant points (the same algorithm as in
BRepCheck; default value is 23 as inBRepCheck). This deviation is returned in <maxdev> parameter. If deviation is greater than tolerance of the edge (i.e. incorrect flag) returns False, else returns True.Parameters (3)edgemaxdevNbControl
ReturnsA result object with fields:
returnValue: the C++ return valuemaxdev: updated value from the call.
- CheckSameParameter(theEdge: TopoDS_Edge, theFace: TopoDS_Face, theMaxdev: number, theNbControl: number): { returnValue: boolean; theMaxdev: number }
Checks the edge to be SameParameter. Calculates the maximal deviation between 3d curve and each pcurve of the edge on <NbControl> equidistant points (the same algorithm as in
BRepCheck; default value is 23 as inBRepCheck). This deviation is returned in <maxdev> parameter. If deviation is greater than tolerance of the edge (i.e. incorrect flag) returns False, else returns True.Parameters (4)theEdgetheFacetheMaxdevtheNbControl
ReturnsA result object with fields:
returnValue: the C++ return valuetheMaxdev: updated value from the call.
- CheckPCurveRange(theFirst: number, theLast: number, thePC: Geom2d_Curve): boolean
Checks possibility for pcurve thePC to have range [theFirst, theLast] (edge range) having respect to real first, last parameters of thePC.
Parameters (3)theFirsttheLastthePC
- CheckOverlapping(theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge, theTolOverlap: number, theDomainDist: number): { returnValue: boolean; theTolOverlap: number }
Checks the first edge is overlapped with second edge. If distance between two edges is less then theTolOverlap edges are overlapped. theDomainDis - length of part of edges on which edges are overlapped.
Parameters (4)theEdge1theEdge2theTolOverlaptheDomainDist
ReturnsA result object with fields:
returnValue: the C++ return valuetheTolOverlap: updated value from the call.
ShapeAnalysis_FreeBoundData
This class is intended to represent free bound and to store its properties.
This class is used by ShapeAnalysis_FreeBoundsProperties class when storing each free bound and its properties.
The properties stored in this class are the following:
- area of the contour,
- perimeter of the contour,
- ratio of average length to average width of the contour,
- average width of contour,
- notches (narrow 'V'-like sub-contours) on the contour and their maximum width.
This class provides methods for setting and getting fields only.
Constructors(2)
Empty constructor.
- constructor(freebound: TopoDS_Wire): ShapeAnalysis_FreeBoundData
Creates object with contour given in the form of
TopoDS_Wire.Parameters (1)freebound
Static methods(2)
- get_type_name(): string
Instance methods(18)
- Clear(): void
Clears all properties of the contour. Contour bound itself is not cleared.
- SetFreeBound(freebound: TopoDS_Wire): void
Sets contour.
Parameters (1)freebound
- SetArea(area: number): void
Sets area of the contour.
Parameters (1)area
- SetPerimeter(perimeter: number): void
Sets perimeter of the contour.
Parameters (1)perimeter
- SetRatio(ratio: number): void
Sets ratio of average length to average width of the contour.
Parameters (1)ratio
- SetWidth(width: number): void
Sets average width of the contour.
Parameters (1)width
- AddNotch(notch: TopoDS_Wire, width: number): void
Adds notch on the contour with its maximum width.
Parameters (2)notchwidth
Returns contour.
- Area(): number
Returns area of the contour.
- Perimeter(): number
Returns perimeter of the contour.
- Ratio(): number
Returns ratio of average length to average width of the contour.
- Width(): number
Returns average width of the contour.
- NbNotches(): number
Returns number of notches on the contour.
Returns sequence of notches on the contour.
- Notch(index: number): TopoDS_Wire
Returns notch on the contour.
Parameters (1)index
- NotchWidth(index: number): number
Returns maximum width of notch specified by its rank number on the contour.
Parameters (1)index
- NotchWidth(notch: TopoDS_Wire): number
Returns maximum width of notch specified as
TopoDS_Wireon the contour.Parameters (1)notch
ShapeAnalysis_FreeBounds
This class is intended to output free bounds of the shape.
Free bounds are the wires consisting of edges referenced by the faces of the shape only once; these are the edges composing the outer boundary of the face or shell (as opposed to internal edges between the faces in the shell or seam edges on closed faces).
This class works on two distinct types of shapes when analyzing their free bounds:
- compound of faces. Analyzer of sewing algorithm (BRepAlgo_Sewing) is used for for forecasting free bounds that would be obtained after performing sewing
- compound of shells. Actual free bounds (edges shared by the only face in the shell) are output in this case.
ShapeAnalysis_Shellis used for that.
When connecting edges into the wires algorithm tries to build wires of maximum length. Two options are provided for a user to extract closed sub-contours out of closed and/or open contours.
Free bounds are returned as two compounds, one for closed and one for open wires.
This class also provides some static methods for advanced use: connecting edges/wires to wires, extracting closed sub-wires out of wires, dispatching wires into compounds for closed and open wires. NOTE. Ends of the edge or wire mean hereafter their end vertices.
Constructors(3)
Empty constructor.
- constructor(shape: TopoDS_Shape, toler: number, splitclosed?: boolean, splitopen?: boolean): ShapeAnalysis_FreeBounds
Builds forecasting free bounds of the <shape>. <shape> should be a compound of faces. This constructor is to be used for forecasting free edges with help of sewing analyzer BRepAlgo_Sewing which is called with tolerance <toler>. Free edges are connected into wires only when their ends are at distance less than <toler>. If <splitclosed> is True extracts closed sub-wires out of built closed wires. If <splitopen> is True extracts closed sub-wires out of built open wires.
Parameters (4)shapetolersplitclosedsplitopen
- constructor(shape: TopoDS_Shape, splitclosed?: boolean, splitopen?: boolean, checkinternaledges?: boolean): ShapeAnalysis_FreeBounds
Builds actual free bounds of the <shape>. <shape> should be a compound of shells. This constructor is to be used for getting free edges (ones referenced by the only face) with help of analyzer
ShapeAnalysis_Shell. Free edges are connected into wires only when they share the same vertex. If <splitclosed> is True extracts closed sub-wires out of built closed wires. If <splitopen> is True extracts closed sub-wires out of built open wires.Parameters (4)shapesplitclosedsplitopencheckinternaledges
Static methods(10)
- ConnectEdgesToWires(edges: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean): NCollection_HSequence_TopoDS_Shape
Builds sequence of <wires> out of sequence of not sorted <edges>. Tries to build wires of maximum length. Building a wire is stopped when no edges can be connected to it at its head or at its tail.
Orientation of the edge can change when connecting. If <shared> is True connection is performed only when adjacent edges share the same vertex. If <shared> is False connection is performed only when ends of adjacent edges are at distance less than <toler>. Connects edges from the given sequence into wires.Parameters (3)edges—the sequence of edges to connecttoler—distance tolerance for connectionshared—if true, connection uses shared vertices only
Returnssequence of resulting wires
- ConnectEdgesToWires_1(edges: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean): NCollection_HSequence_TopoDS_Shape
Builds sequence of <wires> out of sequence of not sorted <edges>. Tries to build wires of maximum length. Building a wire is stopped when no edges can be connected to it at its head or at its tail.
Orientation of the edge can change when connecting. If <shared> is True connection is performed only when adjacent edges share the same vertex. If <shared> is False connection is performed only when ends of adjacent edges are at distance less than <toler>. Connects edges from the given sequence into wires.Parameters (3)edges—the sequence of edges to connecttoler—distance tolerance for connectionshared—if true, connection uses shared vertices only
Returnssequence of resulting wires
- ConnectEdgesToWires_2(edges: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean): { wires: NCollection_HSequence_TopoDS_Shape; [Symbol.dispose](): void }DeprecatedParameters (3)
edgestolershared
ReturnsA result object with fields:
wires: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- ConnectWiresToWires(iwires: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean): NCollection_HSequence_TopoDS_Shape
Connects wires from the given sequence into longer wires.
Parameters (3)iwires—the sequence of input wirestoler—distance tolerance for connectionshared—if true, connection uses shared vertices only
Returnssequence of resulting wires
- ConnectWiresToWires_1(iwires: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean): NCollection_HSequence_TopoDS_Shape
Connects wires from the given sequence into longer wires.
Parameters (3)iwires—the sequence of input wirestoler—distance tolerance for connectionshared—if true, connection uses shared vertices only
Returnssequence of resulting wires
- ConnectWiresToWires_2(iwires: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean): { owires: NCollection_HSequence_TopoDS_Shape; [Symbol.dispose](): void }
Builds sequence of <owires> out of sequence of not sorted <iwires>. Tries to build wires of maximum length. Building a wire is stopped when no wires can be connected to it at its head or at its tail.
Orientation of the wire can change when connecting. If <shared> is True connection is performed only when adjacent wires share the same vertex. If <shared> is False connection is performed only when ends of adjacent wires are at distance less than <toler>. Map <vertices> stores the correspondence between original end vertices of the wires and new connecting vertices. Connects wires from the given sequence into longer wires. Also fills the map of original to new connecting vertices.Parameters (3)iwires—the sequence of input wirestoler—distance tolerance for connectionshared—if true, connection uses shared vertices only
ReturnsA result object with fields:
owires: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- ConnectWiresToWires(iwires: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean, vertices: NCollection_DataMap_TopoDS_Shape_TopoDS_Shape_TopTools_ShapeMapHasher): NCollection_HSequence_TopoDS_Shape
Builds sequence of <owires> out of sequence of not sorted <iwires>. Tries to build wires of maximum length. Building a wire is stopped when no wires can be connected to it at its head or at its tail.
Orientation of the wire can change when connecting. If <shared> is True connection is performed only when adjacent wires share the same vertex. If <shared> is False connection is performed only when ends of adjacent wires are at distance less than <toler>. Map <vertices> stores the correspondence between original end vertices of the wires and new connecting vertices. Connects wires from the given sequence into longer wires. Also fills the map of original to new connecting vertices.Parameters (4)iwires—the sequence of input wirestoler—distance tolerance for connectionshared—if true, connection uses shared vertices onlyvertices—map of original vertices to new connecting vertices Mutated in place; read the updated value from this argument after the call.
Returnssequence of resulting wires
- ConnectWiresToWires(iwires: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean, vertices: NCollection_DataMap_TopoDS_Shape_TopoDS_Shape_TopTools_ShapeMapHasher): { owires: NCollection_HSequence_TopoDS_Shape; [Symbol.dispose](): void }DeprecatedParameters (4)
iwirestolersharedvertices—Mutated in place; read the updated value from this argument after the call.
ReturnsA result object with fields:
owires: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- SplitWires(wires: NCollection_HSequence_TopoDS_Shape, toler: number, shared: boolean): { closed: NCollection_HSequence_TopoDS_Shape; open: NCollection_HSequence_TopoDS_Shape; [Symbol.dispose](): void }
Extracts closed sub-wires out of <wires> and adds them to <closed>, open wires remained after extraction are put into <open>. If <shared> is True extraction is performed only when edges share the same vertex. If <shared> is False connection is performed only when ends of the edges are at distance less than <toler>.
Parameters (3)wirestolershared
ReturnsA result object with fields:
closed: owned by the returned envelope.open: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- DispatchWires(wires: NCollection_HSequence_TopoDS_Shape, closed: TopoDS_Compound, open: TopoDS_Compound): void
Dispatches sequence of <wires> into two compounds <closed> for closed wires and <open> for open wires. If a compound is not empty wires are added into it.
Parameters (3)wiresclosed—Mutated in place; read the updated value from this argument after the call.open—Mutated in place; read the updated value from this argument after the call.
Instance methods(2)
Returns compound of closed wires out of free edges.
Returns compound of open wires out of free edges.
ShapeAnalysis_FreeBoundsProperties
This class is intended to calculate shape free bounds properties. This class provides the following functionalities:
- calculates area of the contour,
- calculates perimeter of the contour,
- calculates ratio of average length to average width of the contour,
- estimates average width of contour,
- finds the notches (narrow 'V'-like sub-contour) on the contour.
For getting free bounds this class usesShapeAnalysis_FreeBoundsclass.
For description of parameters used for initializing this class refer to CDL ofShapeAnalysis_FreeBounds.
Properties of each contour are stored in the data structureShapeAnalysis_FreeBoundData.
Constructors(3)
Empty constructor.
- constructor(shape: TopoDS_Shape, splitclosed?: boolean, splitopen?: boolean): ShapeAnalysis_FreeBoundsProperties
Creates the object and calls corresponding Init. <shape> should be a compound of shells.
Parameters (3)shapesplitclosedsplitopen
- constructor(shape: TopoDS_Shape, tolerance: number, splitclosed?: boolean, splitopen?: boolean): ShapeAnalysis_FreeBoundsProperties
Creates the object and calls corresponding Init. <shape> should be a compound of faces.
Parameters (4)shapetolerancesplitclosedsplitopen
Instance methods(19)
- Init(shape: TopoDS_Shape, tolerance: number, splitclosed: boolean, splitopen: boolean): void
Initializes the object with given parameters. <shape> should be a compound of faces.
Parameters (4)shapetolerancesplitclosedsplitopen
- Init(shape: TopoDS_Shape, splitclosed: boolean, splitopen: boolean): void
Initializes the object with given parameters. <shape> should be a compound of shells.
Parameters (3)shapesplitclosedsplitopen
- Perform(): boolean
Builds and analyzes free bounds of the shape. First calls
ShapeAnalysis_FreeBoundsfor building free bounds. Then on each free bound computes its properties:- area of the contour,
- perimeter of the contour,
- ratio of average length to average width of the contour,
- average width of contour,
- notches on the contour and for each notch
- maximum width of the notch.
- IsLoaded(): boolean
Returns True if shape is loaded.
Returns shape.
- Tolerance(): number
Returns tolerance.
- NbFreeBounds(): number
Returns number of free bounds.
- NbClosedFreeBounds(): number
Returns number of closed free bounds.
- NbOpenFreeBounds(): number
Returns number of open free bounds.
Returns all closed free bounds.
Returns all open free bounds.
- ClosedFreeBound(index: number): ShapeAnalysis_FreeBoundData
Returns properties of closed free bound specified by its rank number.
Parameters (1)index
- OpenFreeBound(index: number): ShapeAnalysis_FreeBoundData
Returns properties of open free bound specified by its rank number.
Parameters (1)index
- DispatchBounds(): boolean
- CheckContours(prec?: number): booleanParameters (1)
prec
- CheckNotches(prec: number): booleanParameters (1)
prec
- CheckNotches(prec: number): { returnValue: boolean; fbData: ShapeAnalysis_FreeBoundData; [Symbol.dispose](): void }Parameters (1)
prec
- CheckNotches(freebound: TopoDS_Wire, num: number, notch: TopoDS_Wire, distMax: number, prec: number): { returnValue: boolean; distMax: number }Parameters (5)
freeboundnumnotchdistMaxprec
- FillProperties(prec: number): { returnValue: boolean; fbData: ShapeAnalysis_FreeBoundData; [Symbol.dispose](): void }Parameters (1)
prec
ShapeAnalysis_Geom
Analyzing tool aimed to work on primitive geometrical objects.
Constructors(1)
Static methods(2)
- NearestPlane(Pnts: NCollection_Array1_gp_Pnt, aPln: gp_Pln, Dmax: number): { returnValue: boolean; Dmax: number }
Builds a plane out of a set of points in array Returns in <dmax> the maximal distance between the produced plane and given points.
Parameters (3)PntsaPln—Mutated in place; read the updated value from this argument after the call.Dmax
ReturnsA result object with fields:
returnValue: the C++ return valueDmax: updated value from the call.
- PositionTrsf(coefs: NCollection_HArray2_double, trsf: gp_Trsf, unit: number, prec: number): boolean
Builds transformation object out of matrix. Matrix must be 3 x 4. Unit is used as multiplier.
Parameters (4)coefstrsf—Mutated in place; read the updated value from this argument after the call.unitprec
ShapeAnalysis_ShapeContents
Dumps shape contents.
Constructors(1)
Initialize fields and call
ClearFlags().
Instance methods(49)
- Clear(): void
Clears all accumulated statistics.
- ClearFlags(): void
Clears all flags.
- Perform(shape: TopoDS_Shape): void
Counts quantities of sun-shapes in shape and stores sub-shapes according to flags.
Parameters (1)shape
- ModifyBigSplineMode(): boolean
Returns (modifiable) the flag which defines whether to store faces with edges if its 3D curves has more than 8192 poles.
- ModifyIndirectMode(): boolean
Returns (modifiable) the flag which defines whether to store faces on indirect surfaces.
- ModifyOffsetSurfaceMode(): boolean
Returns (modifiable) the flag which defines whether to store faces on offset surfaces.
- ModifyTrimmed3dMode(): boolean
Returns (modifiable) the flag which defines whether to store faces with edges if its 3D curves are trimmed curves.
- ModifyOffsetCurveMode(): boolean
Returns (modifiable) the flag which defines whether to store faces with edges if its 3D curves and pcurves are offset curves.
- ModifyTrimmed2dMode(): boolean
Returns (modifiable) the flag which defines whether to store faces with edges if its pcurves are trimmed curves.
- NbSolids(): number
- NbShells(): number
- NbFaces(): number
- NbWires(): number
- NbEdges(): number
- NbVertices(): number
- NbSolidsWithVoids(): number
- NbBigSplines(): number
- NbC0Surfaces(): number
- NbC0Curves(): number
- NbOffsetSurf(): number
- NbIndirectSurf(): number
- NbOffsetCurves(): number
- NbTrimmedCurve2d(): number
- NbTrimmedCurve3d(): number
- NbBSplibeSurf(): number
- NbBezierSurf(): number
- NbTrimSurf(): number
- NbWireWitnSeam(): number
- NbWireWithSevSeams(): number
- NbFaceWithSevWires(): number
- NbNoPCurve(): number
- NbFreeFaces(): number
- NbFreeWires(): number
- NbFreeEdges(): number
- ModifyOffestSurfaceMode(): booleanDeprecated
ShapeAnalysis_ShapeTolerance
Tool for computing shape tolerances (minimal, maximal, average), finding shape with tolerance matching given criteria, setting or limitating tolerances.
Constructors(1)
Empty constructor.
Instance methods(6)
- Tolerance(shape: TopoDS_Shape, mode: number, type_?: TopAbs_ShapeEnum): number
Determines a tolerance from the ones stored in a shape Remark : calls InitTolerance and AddTolerance, hence, can be used to start a series for cumulating tolerance <mode> = 0 : returns the average value between sub-shapes, <mode> > 0 : returns the maximal found, <mode> < 0 : returns the minimal found. <type> defines what kinds of sub-shapes to consider: SHAPE (default) : all : VERTEX, EDGE, FACE, VERTEX : only vertices, EDGE : only edges, FACE : only faces, SHELL : combined SHELL + FACE, for each face (and containing shell), also checks EDGE and VERTEX.
Parameters (3)shapemodetype_
- OverTolerance(shape: TopoDS_Shape, value: number, type_?: TopAbs_ShapeEnum): NCollection_HSequence_TopoDS_Shape
Determines which shapes have a tolerance over the given value <type> is interpreted as in the method Tolerance.
Parameters (3)shapevaluetype_
- InTolerance(shape: TopoDS_Shape, valmin: number, valmax: number, type_?: TopAbs_ShapeEnum): NCollection_HSequence_TopoDS_Shape
Determines which shapes have a tolerance within a given interval <type> is interpreted as in the method Tolerance.
Parameters (4)shapevalminvalmaxtype_
- InitTolerance(): void
Initializes computation of cumulated tolerance.
- AddTolerance(shape: TopoDS_Shape, type_?: TopAbs_ShapeEnum): void
Adds data on new Shape to compute Cumulated Tolerance (prepares three computations : maximal, average, minimal).
Parameters (2)shapetype_
- GlobalTolerance(mode: number): number
Returns the computed tolerance according to the <mode> <mode> = 0 : average <mode> > 0 : maximal <mode> < 0 : minimal.
Parameters (1)mode
ShapeAnalysis_Shell
This class provides operators to analyze edges orientation in the shell.
Constructors(1)
Empty constructor.
Instance methods(11)
- Clear(): void
Clears data about loaded shells and performed checks.
- LoadShells(shape: TopoDS_Shape): void
Adds shells contained in the <shape> to the list of loaded shells.
Parameters (1)shape
- CheckOrientedShells(shape: TopoDS_Shape, alsofree?: boolean, checkinternaledges?: boolean): boolean
Checks if shells fulfill orientation condition, i.e. if each edge is, either present once (free edge) or twice (connected edge) but with different orientations (FORWARD/REVERSED) Edges which do not fulfill these conditions are bad.
If <alsofree> is True free edges are considered. Free edges can be queried but are not badParameters (3)shapealsofreecheckinternaledges
- IsLoaded(shape: TopoDS_Shape): boolean
Tells if a shape is loaded (only shells are checked).
Parameters (1)shape
- NbLoaded(): number
Returns the actual number of loaded shapes (i.e. shells).
- Loaded(num: number): TopoDS_Shape
Returns a loaded shape specified by its rank number. Returns null shape if <num> is out of range.
Parameters (1)num
- HasBadEdges(): boolean
Tells if at least one edge is recorded as bad.
Returns the list of bad edges as a Compound It is empty (not null) if no edge are recorded as bad.
- HasFreeEdges(): boolean
Tells if at least one edge is recorded as free (not connected).
Returns the list of free (not connected) edges as a Compound It is empty (not null) if no edge are recorded as free.
- HasConnectedEdges(): boolean
Tells if at least one edge is connected (shared twice or more).
ShapeAnalysis_Surface
Complements standard tool Geom_Surface by providing additional functionality for detection surface singularities, checking spatial surface closure and computing projections of 3D points onto a surface.
- The singularities Each singularity stores the precision with which corresponding surface iso-line is considered as degenerated. The number of singularities is determined by specifying precision and always not greater than 4.
- The spatial closure The check for spatial closure is performed with given precision (default value is
Precision::Confusion). IfGeom_Surfacesays that the surface is closed, this class also says this. Otherwise additional analysis is performed. - The parameters of 3D point on the surface The projection of the point is performed with given precision. This class tries to find a solution taking into account possible singularities. Additional method for searching the solution from already built one is also provided.
This tool is optimised: computes most information only once
Constructors(1)
Creates an analyzer object on the basis of existing surface.
Parameters (1)S
Static methods(2)
- get_type_name(): string
Instance methods(33)
- Init(S: Geom_Surface): void
Loads existing surface.
Parameters (1)S
- Init(other: ShapeAnalysis_Surface): void
Reads all the data from another Surface, without recomputing.
Parameters (1)other
- SetDomain(U1: number, U2: number, V1: number, V2: number): voidParameters (4)
U1U2V1V2
Returns a surface being analyzed.
Returns the Adaptor. Creates it if not yet done.
Returns the Adaptor (may be Null if method Adaptor() was not called).
- Gap(): number
Returns 3D distance found by one of the following methods. IsDegenerated, DegeneratedValues, ProjectDegenerated (distance between 3D point and found or last (if not found) singularity), IsUClosed, IsVClosed (minimum value of precision to consider the surface to be closed), ValueOfUV (distance between 3D point and found solution).
Returns a 3D point specified by parameters in surface parametrical space.
Parameters (2)uv
Returns a 3d point specified by a point in surface parametrical space.
Parameters (1)p2d
- HasSingularities(preci: number): boolean
Returns True if the surface has singularities for the given precision (i.e. if there are surface singularities with sizes not greater than precision).
Parameters (1)preci
- NbSingularities(preci: number): number
Returns the number of singularities for the given precision (i.e. number of surface singularities with sizes not greater than precision).
Parameters (1)preci
- Singularity(num: number, preci: number, P3d: gp_Pnt, firstP2d: gp_Pnt2d, lastP2d: gp_Pnt2d, firstpar: number, lastpar: number, uisodeg: boolean): { returnValue: boolean; preci: number; firstpar: number; lastpar: number; uisodeg: boolean }
Returns the characteristics of the singularity specified by its rank number <num>. That means, that it is not necessary for <num> to be in the range [1, NbSingularities] but must be not greater than possible (see ComputeSingularities).
The returned characteristics are: preci: the smallest precision with which the iso-line is considered as degenerated, P3d: 3D point of singularity (middle point of the surface iso-line), firstP2d and lastP2d: first and last 2D points of the iso-line in parametrical surface, firstpar and lastpar: first and last parameters of the iso-line in parametrical surface, uisodeg: if the degenerated iso-line is U-iso (True) or V-iso (False). Returns False if <num> is out of range, else returns True.Parameters (8)numpreciP3d—Mutated in place; read the updated value from this argument after the call.firstP2d—Mutated in place; read the updated value from this argument after the call.lastP2d—Mutated in place; read the updated value from this argument after the call.firstparlastparuisodeg
ReturnsA result object with fields:
returnValue: the C++ return valuepreci: updated value from the call.firstpar: updated value from the call.lastpar: updated value from the call.uisodeg: updated value from the call.
- IsDegenerated(P3d: gp_Pnt, preci: number): boolean
Returns True if there is at least one surface boundary which is considered as degenerated with <preci> and distance between P3d and corresponding singular point is less than <preci>.
Parameters (2)P3dpreci
- IsDegenerated(p2d1: gp_Pnt2d, p2d2: gp_Pnt2d, tol: number, ratio: number): boolean
Returns True if straight pcurve going from point p2d1 to p2d2 is degenerate, i.e. lies in the singularity of the surface. NOTE: it uses another method of detecting singularity than used by ComputeSingularities() et al.! For that, maximums of distances between points p2d1, p2d2 and 0.5*(p2d1+p2d2) and between corresponding 3d points are computed. The pcurve (p2d1, p2d2) is considered as degenerate if:
- max distance in 3d is less than <tol>
- max distance in 2d is at least <ratio> times greater than the Resolution computed from max distance in 3d (max3d < tol && max2d > ratio * Resolution(max3d)) NOTE: <ratio> should be >1 (e.g. 10)
Parameters (4)p2d1p2d2tolratio
- DegeneratedValues(P3d: gp_Pnt, preci: number, firstP2d: gp_Pnt2d, lastP2d: gp_Pnt2d, firstpar: number, lastpar: number, forward: boolean): { returnValue: boolean; firstpar: number; lastpar: number }
Returns True if there is at least one surface iso-line which is considered as degenerated with <preci> and distance between P3d and corresponding singular point is less than <preci> (like IsDegenerated). Returns characteristics of the first found boundary matching those criteria.
Parameters (7)P3dprecifirstP2d—Mutated in place; read the updated value from this argument after the call.lastP2d—Mutated in place; read the updated value from this argument after the call.firstparlastparforward
ReturnsA result object with fields:
returnValue: the C++ return valuefirstpar: updated value from the call.lastpar: updated value from the call.
- ProjectDegenerated(P3d: gp_Pnt, preci: number, neighbour: gp_Pnt2d, result: gp_Pnt2d): boolean
Projects a point <P3d> on a singularity by computing one of the coordinates of preliminary computed <result>.
Finds the iso-line which is considered as degenerated with <preci> and a. distance between P3d and corresponding singular point is less than <preci> (like IsDegenerated) or b. difference between already computed <result>'s coordinate and iso-coordinate of the boundary is less than 2D resolution (computed from <preci> by Geom_Adaptor). Then sets not yet computed <result>'s coordinate taking it from <neighbour> and returns True.Parameters (4)P3dprecineighbourresult—Mutated in place; read the updated value from this argument after the call.
- ProjectDegenerated(nbrPnt: number, points: NCollection_Sequence_gp_Pnt, pnt2d: NCollection_Sequence_gp_Pnt2d, preci: number, direct: boolean): boolean
Checks points at the beginning (direct is True) or end (direct is False) of array <points> to lie in singularity of surface, and if yes, adjusts the indeterminate 2d coordinate of these points by nearest point which is not in singularity. Returns True if some points were adjusted.
Parameters (5)nbrPntpointspnt2d—Mutated in place; read the updated value from this argument after the call.precidirect
- Bounds(ufirst: number, ulast: number, vfirst: number, vlast: number): { ufirst: number; ulast: number; vfirst: number; vlast: number }
Returns the bounds of the surface (from Bounds from Surface, but buffered).
Parameters (4)ufirstulastvfirstvlast
ReturnsA result object with fields:
ufirst: updated value from the call.ulast: updated value from the call.vfirst: updated value from the call.vlast: updated value from the call.
- ComputeBoundIsos(): void
Computes bound isos (protected against exceptions).
- UIso(U: number): Geom_Curve
Returns a U-Iso. Null if not possible or failed Remark : bound isos are buffered.
Parameters (1)U
- VIso(V: number): Geom_Curve
Returns a V-Iso. Null if not possible or failed Remark : bound isos are buffered.
Parameters (1)V
- IsUClosed(preci?: number): boolean
Tells if the Surface is spatially closed in U with given precision. If <preci> < 0 then
Precision::Confusionis used. IfGeom_Surfacesays that the surface is U-closed, this method also says this. Otherwise additional analysis is performed, comparing given precision with the following distances:- periodic B-Splines are closed,
- polynomial B-Spline with boundary multiplicities degree+1 and Bezier - maximum distance between poles,
- rational B-Spline or one with boundary multiplicities not degree+1 - maximum distance computed at knots and their middles,
- surface of extrusion - distance between ends of basis curve,
- other (RectangularTrimmed and Offset) - maximum distance computed at 100 equi-distanted points.
Parameters (1)preci
- IsVClosed(preci?: number): boolean
Tells if the Surface is spatially closed in V with given precision. If <preci> < 0 then
Precision::Confusionis used. IfGeom_Surfacesays that the surface is V-closed, this method also says this. Otherwise additional analysis is performed, comparing given precision with the following distances:- periodic B-Splines are closed,
- polynomial B-Spline with boundary multiplicities degree+1 and Bezier - maximum distance between poles,
- rational B-Spline or one with boundary multiplicities not degree+1 - maximum distance computed at knots and their middles,
- surface of revolution - distance between ends of basis curve,
- other (RectangularTrimmed and Offset) - maximum distance computed at 100 equi-distanted points.
Parameters (1)preci
Computes the parameters in the surface parametrical space of 3D point. The result is parameters of the point projected onto the surface. This method enhances functionality provided by the standard tool GeomAPI_ProjectPointOnSurface by treatment of cases when the projected point is near to the surface boundaries and when this standard tool fails.
Parameters (2)P3Dpreci
- NextValueOfUV(p2dPrev: gp_Pnt2d, P3D: gp_Pnt, preci: number, maxpreci?: number): gp_Pnt2d
Projects a point P3D on the surface. Does the same thing as ValueOfUV but tries to optimize computations by taking into account previous point <p2dPrev>: makes a step by UV and tries Newton algorithm. If <maxpreci> >0. and distance between solution and P3D is greater than <maxpreci>, that solution is considered as bad, and
ValueOfUV()is used. If not succeeded, callsValueOfUV().Parameters (4)p2dPrevP3Dprecimaxpreci
- UVFromIso(P3D: gp_Pnt, preci: number, U: number, V: number): { returnValue: number; U: number; V: number }
Tries a refinement of an already computed couple (U,V) by using projecting 3D point on iso-lines:
- boundaries of the surface,
- iso-lines passing through (U,V)
- iteratively received iso-lines passing through new U and new V (number of iterations is limited by 5 in each direction) Returns the best resulting distance between P3D and Value(U,V) in the case of success. Else, returns a very great value
Parameters (4)P3DpreciUV
ReturnsA result object with fields:
returnValue: the C++ return valueU: updated value from the call.V: updated value from the call.
- UCloseVal(): number
Returns minimum value to consider the surface as U-closed.
- VCloseVal(): number
Returns minimum value to consider the surface as V-closed.
ShapeAnalysis_TransferParameters
This tool is used for transferring parameters from 3d curve of the edge to pcurve and vice versa.
Default behaviour is to trsnafer parameters with help of linear transformation:
T2d = myShift + myScale * T3d where myScale = ( Last2d - First2d ) / ( Last3d - First3d ) myShift = First2d - First3d * myScale [First3d, Last3d] and [First2d, Last2d] are ranges of edge on curve and pcurve
This behaviour can be redefined in derived classes, for example, using projection.
Constructors(2)
Creates empty tool with myShift = 0 and myScale = 1.
Creates a tool and initializes it with edge and face.
Parameters (2)EF
Static methods(2)
- get_type_name(): string
Instance methods(7)
- Init(E: TopoDS_Edge, F: TopoDS_Face): void
Initialize a tool with edge and face.
Parameters (2)EF
- SetMaxTolerance(maxtol: number): void
Sets maximal tolerance to use linear recomputation of parameters.
Parameters (1)maxtol
- Perform(Params: NCollection_HSequence_double, To2d: boolean): NCollection_HSequence_double
Transfers parameters given by sequence Params from 3d curve to pcurve (if To2d is True) or back (if To2d is False).
Parameters (2)ParamsTo2d
- Perform(Param: number, To2d: boolean): number
Transfers parameter given by sequence Params from 3d curve to pcurve (if To2d is True) or back (if To2d is False).
Parameters (2)ParamTo2d
- TransferRange(newEdge: TopoDS_Edge, prevPar: number, currPar: number, To2d: boolean): void
Recomputes range of curves from NewEdge. If Is2d equals True parameters are recomputed by curve2d else by curve3d.
Parameters (4)newEdge—Mutated in place; read the updated value from this argument after the call.prevParcurrParTo2d
- IsSameRange(): boolean
Returns True if 3d curve of edge and pcurve are SameRange (in default implementation, if myScale == 1 and myShift == 0).
ShapeAnalysis_TransferParametersProj
This tool is used for transferring parameters from 3d curve of the edge to pcurve and vice versa. This tool transfers parameters with help of projection points from curve 3d on curve 2d and vice versa.
Constructors(2)
Creates empty constructor.
- Parameters (2)
EF
Static methods(4)
- CopyNMVertex(theVert: TopoDS_Vertex, toedge: TopoDS_Edge, fromedge: TopoDS_Edge): TopoDS_Vertex
Make a copy of non-manifold vertex theVert (i.e. create new TVertex and replace PointRepresentations for this vertex from fromedge to toedge. Other representations were copied).
Parameters (3)theVerttoedgefromedge
- CopyNMVertex(theVert: TopoDS_Vertex, toFace: TopoDS_Face, fromFace: TopoDS_Face): TopoDS_Vertex
Make a copy of non-manifold vertex theVert (i.e. create new TVertex and replace PointRepresentations for this vertex from fromFace to toFace. Other representations were copied).
Parameters (3)theVerttoFacefromFace
- get_type_name(): string
Instance methods(7)
- Init(E: TopoDS_Edge, F: TopoDS_Face): void
Initialize a tool with edge and face.
Parameters (2)EF
- Perform(Params: NCollection_HSequence_double, To2d: boolean): NCollection_HSequence_double
Transfers parameters given by sequence Params from 3d curve to pcurve (if To2d is True) or back (if To2d is False).
Parameters (2)ParamsTo2d
- Perform(Param: number, To2d: boolean): number
Transfers parameter given by Param from 3d curve to pcurve (if To2d is True) or back (if To2d is False).
Parameters (2)ParamTo2d
- ForceProjection(): boolean
Returns modifiable flag forcing projection If it is False (default), projection is done only if edge is not SameParameter or if tolerance of edge is greater than MaxTolerance().
- TransferRange(newEdge: TopoDS_Edge, prevPar: number, currPar: number, To2d: boolean): void
Recomputes range of curves from NewEdge. If Is2d equals True parameters are recomputed by curve2d else by curve3d.
Parameters (4)newEdge—Mutated in place; read the updated value from this argument after the call.prevParcurrParTo2d
- IsSameRange(): boolean
Returns False;.
ShapeAnalysis_Wire
This class provides analysis of a wire to be compliant to CAS.CADE requirements.
The functionalities provided are the following:
- consistency of 2d and 3d edge curve senses
- connection of adjacent edges regarding to: a. their vertices b. their pcurves c. their 3d curves
- adjacency of the edge vertices to its pcurve and 3d curve
- if a wire is closed or not (considering its 3d and 2d contour)
- if a wire is outer on its face (considering pcurves)
This class can be used in conjunction with classShapeFix_Wire, which will fix the problems detected by this class.
The methods of the given class match to ones of the classShapeFix_Wire, e.g., CheckSmall and FixSmall. This class also includes some auxiliary methods (e.g., CheckOuterBound, etc.), which have no pair inShapeFix_Wire.
Like methods ofShapeFix_Wirethe ones of this class are grouped into two levels:
- Public which are recommended for use (the most global method is Perform),
- Advanced, for optional use only
For analyzing result of Public API checking methods use corresponding Status... method. The 'advanced' functions share the single status field which contains the result of the last performed 'advanced' method. It is queried by the methodLastCheckStatus().
In order to prepare an analyzer, it is necessary to load a wire, set face and precision.
Constructors(3)
Empty constructor.
- constructor(wire: TopoDS_Wire, face: TopoDS_Face, precision: number): ShapeAnalysis_Wire
Creates object with standard
TopoDS_Wire, face and precision.Parameters (3)wirefaceprecision
- constructor(sbwd: ShapeExtend_WireData, face: TopoDS_Face, precision: number): ShapeAnalysis_Wire
Creates the object with WireData object, face and precision.
Parameters (3)sbwdfaceprecision
Static methods(2)
- get_type_name(): string
Instance methods(73)
- Init(wire: TopoDS_Wire, face: TopoDS_Face, precision: number): void
Initializes the object with standard
TopoDS_Wire, face and precision.Parameters (3)wirefaceprecision
- Init(sbwd: ShapeExtend_WireData, face: TopoDS_Face, precision: number): void
Initializes the object with WireData object, face and precision.
Parameters (3)sbwdfaceprecision
- Load(wire: TopoDS_Wire): void
Loads the object with standard
TopoDS_Wire.Parameters (1)wire
- Load(sbwd: ShapeExtend_WireData): void
Loads the object with WireData object.
Parameters (1)sbwd
- SetFace(face: TopoDS_Face): void
Loads the face the wire lies on.
Parameters (1)face
- SetFace(theFace: TopoDS_Face, theSurfaceAnalysis: ShapeAnalysis_Surface): void
Loads the face the wire lies on and surface analysis object.
Parameters (2)theFacetheSurfaceAnalysis
- SetSurface(theSurfaceAnalysis: ShapeAnalysis_Surface): void
Loads the surface analysis object.
Parameters (1)theSurfaceAnalysis
- SetSurface(surface: Geom_Surface): void
Loads the surface the wire lies on.
Parameters (1)surface
- SetSurface(surface: Geom_Surface, location: TopLoc_Location): void
Loads the surface the wire lies on.
Parameters (2)surfacelocation
- SetPrecision(precision: number): voidParameters (1)
precision
- ClearStatuses(): void
Unsets all the status and distance fields wire, face and precision are not cleared.
- IsLoaded(): boolean
Returns True if wire is loaded and has number of edges >0.
- IsReady(): boolean
Returns True if IsLoaded and underlying face is not null.
- Precision(): number
Returns the value of precision.
Returns wire object being analyzed.
- NbEdges(): number
Returns the number of edges in the wire, or 0 if it is not loaded.
- Face(): TopoDS_Face
Returns the working face.
Returns the working surface.
- Perform(): boolean
Performs all the checks in the following order : CheckOrder, CheckSmall, CheckConnected, CheckEdgeCurves, CheckDegenerated, CheckSelfIntersection, CheckLacking, CheckClosed Returns: True if at least one method returned True; For deeper analysis use Status...(status) methods.
- CheckOrder(isClosed: boolean, mode3d: boolean): boolean
Calls CheckOrder and returns False if wire is already ordered (tail-to-head), True otherwise Flag <isClosed> defines if the wire is closed or not Flag <mode3d> defines which mode is used (3d or 2d).
Parameters (2)isClosedmode3d
- CheckOrder(sawo: ShapeAnalysis_WireOrder, isClosed: boolean, theMode3D: boolean, theModeBoth: boolean): boolean
Analyzes the order of the edges in the wire, uses class WireOrder for that purpose. Flag <isClosed> defines if the wire is closed or not Flag <theMode3D> defines 3D or 2d mode. Flag <theModeBoth> defines miscible mode and the flag <theMode3D> is ignored. Returns False if wire is already ordered (tail-to-head), True otherwise. Use returned WireOrder object for deeper analysis.
Status: OK : the same edges orientation, the same edges sequence DONE1: the same edges orientation, not the same edges sequence DONE2: as DONE1 and gaps more than myPrecision DONE3: not the same edges orientation (some need to be reversed) DONE4: as DONE3 and gaps more than myPrecision FAIL : algorithm failed (could not detect order).Parameters (4)sawo—Mutated in place; read the updated value from this argument after the call.isClosedtheMode3DtheModeBoth
- CheckConnected(prec: number): boolean
Calls to CheckConnected for each edge Returns: True if at least one pair of disconnected edges (not sharing the same vertex) was detected.
Parameters (1)prec
- CheckConnected(num: number, prec: number): boolean
Checks connected edges (num-th and preceding). Tests with starting preci from <SBWD> or with <prec> if it is greater. Considers Vertices. Returns: False if edges are connected by the common vertex, else True Status : OK : Vertices (end of num-1 th edge and start on num-th one) are already the same DONE1 : Absolutely confused (
gp::Resolution) DONE2 : Confused at starting <preci> from <SBWD> DONE3 : Confused at <prec> but not <preci> FAIL1 : Not confused FAIL2 : Not confused but confused with <preci> if reverse num-th edge.Parameters (2)numprec
- CheckSmall(precsmall: number): boolean
Calls to CheckSmall for each edge Returns: True if at least one small edge was detected.
Parameters (1)precsmall
- CheckSmall(num: number, precsmall: number): boolean
Checks if an edge has a length not greater than myPreci or precsmall (if it is smaller) Returns: False if its length is greater than precision Status: OK : edge is not small or degenerated DONE1: edge is small, vertices are the same DONE2: edge is small, vertices are not the same FAIL : no 3d curve and pcurve.
Parameters (2)numprecsmall
- CheckEdgeCurves(): boolean
Checks edges geometry (consistency of 2d and 3d senses, adjasment of curves to the vertices, etc.). The order of the checks : Call
ShapeAnalysis_Wireto check:ShapeAnalysis_Edge::CheckCurve3dWithPCurve(1), ShapeAnalysis_Edge::CheckVertcesWithPCurve (2), ShapeAnalysis_Edge::CheckVertcesWithCurve3d (3), CheckSeam (4) Additional: CheckGap3d (5), CheckGap2d (6),ShapeAnalysis_Edge::CheckSameParameter(7) Returns: True if at least one check returned True Remark: The numbers in brackets show with what DONEi or FAILi the status can be queried. - CheckDegenerated(): boolean
Calls to CheckDegenerated for each edge Returns: True if at least one incorrect degenerated edge was detected.
- CheckDegenerated(num: number, dgnr1: gp_Pnt2d, dgnr2: gp_Pnt2d): boolean
Checks for degenerated edge between two adjacent ones.
Fills parameters dgnr1 and dgnr2 with points in parametric space that correspond to the singularity (either gap that needs to be filled by degenerated edge or that already filled) Returns: False if no singularity or edge is already degenerated, otherwise True Status: OK : No surface singularity, or edge is already degenerated DONE1: Degenerated edge should be inserted (gap in 2D) DONE2: Edge <num> should be made degenerated (recompute pcurve and set the flag) FAIL1: One of edges neighbouring to degenerated one has no pcurve FAIL2: Edge marked as degenerated and has no pcurve but singularity is not detected.Parameters (3)numdgnr1—Mutated in place; read the updated value from this argument after the call.dgnr2—Mutated in place; read the updated value from this argument after the call.
- CheckDegenerated(num: number): boolean
Checks for degenerated edge between two adjacent ones. Remark : Calls previous function Status : See the function above for details.
Parameters (1)num
- CheckClosed(prec?: number): boolean
Checks if wire is closed, performs CheckConnected, CheckDegenerated and CheckLacking for the first and the last edges Returns: True if at least one check returned True Status: FAIL1 or DONE1: see CheckConnected FAIL2 or DONE2: see CheckDegenerated.
Parameters (1)prec
- CheckSelfIntersection(): boolean
Checks self-intersection of the wire (considering pcurves) Looks for self-intersecting edges and each pair of intersecting edges. Warning: It does not check each edge with any other one (only each two adjacent edges) The order of the checks : CheckSelfIntersectingEdge, CheckIntersectingEdges Returns: True if at least one check returned True Status: FAIL1 or DONE1 - see CheckSelfIntersectingEdge FAIL2 or DONE2 - see CheckIntersectingEdges.
- CheckLacking(): boolean
Calls to CheckLacking for each edge Returns: True if at least one lacking edge was detected.
- CheckLacking(num: number, Tolerance: number, p2d1: gp_Pnt2d, p2d2: gp_Pnt2d): boolean
Checks if there is a gap in 2d between edges, not comprised by the tolerance of their common vertex. If <Tolerance> is greater than 0. and less than tolerance of the vertex, then this value is used for check. Returns: True if not closed gap was detected p2d1 and p2d2 are the endpoint of <num-1>th edge and start of the <num>th edge in 2d.
Status: OK: No edge is lacking (3d and 2d connection) FAIL1: edges have no vertices (at least one of them) FAIL2: edges are neither connected by common vertex, nor have coincided vertices FAIL1: edges have no pcurves DONE1: the gap is detected which cannot be closed by the tolerance of the common vertex (or with value of <Tolerance>) DONE2: is set (together with DONE1) if gap is detected and the vector (p2d2 - p2d1) goes in direction opposite to the pcurves of the edges (if angle is more than 0.9*PI).Parameters (4)numTolerancep2d1—Mutated in place; read the updated value from this argument after the call.p2d2—Mutated in place; read the updated value from this argument after the call.
- CheckLacking(num: number, Tolerance: number): boolean
Checks if there is a gap in 2D between edges and not comprised by vertex tolerance The value of SBWD.thepreci is used. Returns: False if no edge should be inserted Status: OK : No edge is lacking (3d and 2d connection) DONE1 : The vertex tolerance should be increased only (2d gap is small) DONE2 : Edge can be inserted (3d and 2d gaps are large enough).
Parameters (2)numTolerance
- CheckGaps3d(): boolean
- CheckGaps2d(): boolean
- CheckCurveGaps(): boolean
- CheckSeam(num: number, cf: number, cl: number): { returnValue: boolean; C1: Geom2d_Curve; C2: Geom2d_Curve; cf: number; cl: number; [Symbol.dispose](): void }
Checks if a seam pcurves are correct oriented Returns: False (status OK) if given edge is not a seam or if it is OK C1 - current pcurve for FORWARD edge, C2 - current pcurve for REVERSED edge (if returns True they should be swapped for the seam), cf, cl - first and last parameters on curves Status: OK : Pcurves are correct or edge is not seam DONE : Seam pcurves should be swapped.
Parameters (3)numcfcl
ReturnsA result object with fields:
returnValue: the C++ return valueC1: owned by the returned envelope.C2: owned by the returned envelope.cf: updated value from the call.cl: updated value from the call.
Dispose the returned envelope to release owned Handle fields.
- CheckSeam(num: number): boolean
Checks if a seam pcurves are correct oriented See previous functions for details.
Parameters (1)num
- CheckGap3d(num?: number): boolean
Checks gap between edges in 3D (3d curves). Checks the distance between ends of 3d curves of the num-th and preceding edge. The distance can be queried by MinDistance3d.
Returns: True if status is DONE Status: OK : Gap is less than myPrecision DONE : Gap is greater than myPrecision FAIL : No 3d curve(s) on the edge(s)Parameters (1)num
- CheckGap2d(num?: number): boolean
Checks gap between edges in 2D (pcurves). Checks the distance between ends of pcurves of the num-th and preceding edge. The distance can be queried by MinDistance2d.
Returns: True if status is DONE Status: OK : Gap is less than parametric precision out of myPrecision DONE : Gap is greater than parametric precision out of myPrecision FAIL : No pcurve(s) on the edge(s)Parameters (1)num
- CheckCurveGap(num?: number): boolean
Checks gap between points on 3D curve and points on surface generated by pcurve of the num-th edge. The distance can be queried by MinDistance3d.
Returns: True if status is DONE Status: OK : Gap is less than myPrecision DONE : Gap is greater than myPrecision FAIL : No 3d curve(s) on the edge(s)Parameters (1)num
- CheckSelfIntersectingEdge(num: number, points2d: NCollection_Sequence_IntRes2d_IntersectionPoint, points3d: NCollection_Sequence_gp_Pnt): boolean
Checks if num-th edge is self-intersecting. Self-intersection is reported only if intersection point lies outside of both end vertices of the edge. Returns: True if edge is self-intersecting. If returns True it also fills the sequences of intersection points and corresponding 3d points (only that are not enclosed by a vertices) Status: FAIL1 : No pcurve FAIL2 : No vertices DONE1 : Self-intersection found.
Parameters (3)numpoints2d—Mutated in place; read the updated value from this argument after the call.points3d—Mutated in place; read the updated value from this argument after the call.
- CheckSelfIntersectingEdge(num: number): booleanParameters (1)
num
- CheckIntersectingEdges(num: number, points2d: NCollection_Sequence_IntRes2d_IntersectionPoint, points3d: NCollection_Sequence_gp_Pnt, errors: NCollection_Sequence_double): boolean
Checks two adjacent edges for intersecting. Intersection is reported only if intersection point is not enclosed by the common end vertex of the edges. Returns: True if intersection is found. If returns True it also fills the sequences of intersection points, corresponding 3d points, and errors for them (half-distances between intersection points in 3d calculated from one and from another edge) Status: FAIL1 : No pcurve FAIL2 : No vertices DONE1 : Self-intersection found.
Parameters (4)numpoints2d—Mutated in place; read the updated value from this argument after the call.points3d—Mutated in place; read the updated value from this argument after the call.errors—Mutated in place; read the updated value from this argument after the call.
- CheckIntersectingEdges(num: number): boolean
Checks two adjacent edges for intersecting. Remark : Calls the previous method Status : See the function above for details.
Parameters (1)num
- CheckIntersectingEdges(num1: number, num2: number, points2d: NCollection_Sequence_IntRes2d_IntersectionPoint, points3d: NCollection_Sequence_gp_Pnt, errors: NCollection_Sequence_double): boolean
Checks i-th and j-th edges for intersecting. Remark : See the previous method for details.
Parameters (5)num1num2points2d—Mutated in place; read the updated value from this argument after the call.points3d—Mutated in place; read the updated value from this argument after the call.errors—Mutated in place; read the updated value from this argument after the call.
- CheckIntersectingEdges(num1: number, num2: number): boolean
Checks i-th and j-th edges for intersecting. Remark : Calls previous method. Status : See the function above for details.
Parameters (2)num1num2
- CheckOuterBound(APIMake?: boolean): boolean
Checks if wire defines an outer bound on the face Uses
ShapeAnalysis::IsOuterBoundfor analysis If <APIMake> is True uses BRepAPI_MakeWire to build the wire, if False (to be used only when edges share common vertices) usesBRep_Builderto build the wire.Parameters (1)APIMake
- CheckNotchedEdges(num: number, shortNum: number, param: number, Tolerance: number): { returnValue: boolean; shortNum: number; param: number }
Detects a notch.
Parameters (4)numshortNumparamTolerance
ReturnsA result object with fields:
returnValue: the C++ return valueshortNum: updated value from the call.param: updated value from the call.
- CheckSmallArea(theWire: TopoDS_Wire): boolean
Checks if wire has parametric area less than precision.
Parameters (1)theWire
- CheckShapeConnect(shape: TopoDS_Shape, prec: number): boolean
Checks with what orientation <shape> (wire or edge) can be connected to the wire. Tests distances with starting <preci> from <SBWD> (close confusion), but if given <prec> is greater, tests with <prec> (coarse confusion). The smallest found distance can be returned by MinDistance3d.
Returns: False if status is FAIL (see below) Status: DONE1 : If <shape> follows <SBWD>, direct sense (normal) DONE2 : If <shape> follows <SBWD>, but if reversed DONE3 : If <shape> precedes <SBWD>, direct sense DONE4 : If <shape> precedes <SBWD>, but if reversed FAIL1 : If <shape> is neither an edge nor a wire FAIL2 : If <shape> cannot be connected to <SBWD>
DONE5 : To the tail of <SBWD> the <shape> is closer with direct sense DONE6 : To the head of <SBWD> the <shape> is closer with direct sense
Remark: Statuses DONE1 - DONE4, FAIL1 - FAIL2 are basic and describe the nearest connection of the <shape> to <SBWD>. Statuses DONE5 and DONE6 are advanced and are to be used when analyzing with what sense (direct or reversed) the <shape> should be connected to <SBWD>: For tail of <SBWD> if DONE4 is True <shape> should be direct, otherwise reversed. For head of <SBWD> if DONE5 is True <shape> should be direct, otherwise reversed.Parameters (2)shapeprec
- CheckShapeConnect(tailhead: number, tailtail: number, headtail: number, headhead: number, shape: TopoDS_Shape, prec: number): { returnValue: boolean; tailhead: number; tailtail: number; headtail: number; headhead: number }
The same as previous CheckShapeConnect but is more advanced. It returns the distances between each end of <sbwd> and each end of <shape>. For example, <tailhead> stores distance between tail of <sbwd> and head of <shape> Remark: First method CheckShapeConnect calls this one.
Parameters (6)tailheadtailtailheadtailheadheadshapeprec
ReturnsA result object with fields:
returnValue: the C++ return valuetailhead: updated value from the call.tailtail: updated value from the call.headtail: updated value from the call.headhead: updated value from the call.
- CheckLoop(aMapLoopVertices: NCollection_IndexedMap_TopoDS_Shape_TopTools_ShapeMapHasher, aMapVertexEdges: NCollection_DataMap_TopoDS_Shape_NCollection_List_TopoDS_Shape_TopTools_ShapeMapHasher, aMapSmallEdges: NCollection_Map_TopoDS_Shape_TopTools_ShapeMapHasher, aMapSeemEdges: NCollection_Map_TopoDS_Shape_TopTools_ShapeMapHasher): boolean
Checks existence of loop on wire and return vertices which are loop vertices (vertices belonging to a few pairs of edges).
Parameters (4)aMapLoopVertices—Mutated in place; read the updated value from this argument after the call.aMapVertexEdges—Mutated in place; read the updated value from this argument after the call.aMapSmallEdges—Mutated in place; read the updated value from this argument after the call.aMapSeemEdges—Mutated in place; read the updated value from this argument after the call.
- CheckTail(theEdge1: TopoDS_Edge, theEdge2: TopoDS_Edge, theMaxSine: number, theMaxWidth: number, theMaxTolerance: number, theEdge11: TopoDS_Edge, theEdge12: TopoDS_Edge, theEdge21: TopoDS_Edge, theEdge22: TopoDS_Edge): booleanParameters (9)
theEdge1theEdge2theMaxSinetheMaxWidththeMaxTolerancetheEdge11theEdge12theEdge21theEdge22
- StatusOrder(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusConnected(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusEdgeCurves(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusDegenerated(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusClosed(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusSmall(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusSelfIntersection(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusLacking(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusGaps3d(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusGaps2d(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusCurveGaps(Status: ShapeExtend_Status): booleanParameters (1)
Status
- StatusLoop(Status: ShapeExtend_Status): booleanParameters (1)
Status
- LastCheckStatus(Status: ShapeExtend_Status): boolean
Querying the status of the LAST performed 'Advanced' checking procedure.
Parameters (1)Status
- MinDistance3d(): number
Returns the last lowest distance in 3D computed by CheckOrientation, CheckConnected, CheckContinuity3d, CheckVertex, CheckNewVertex.
- MinDistance2d(): number
Returns the last lowest distance in 2D-UV computed by CheckContinuity2d.
- MaxDistance3d(): number
Returns the last maximal distance in 3D computed by CheckOrientation, CheckConnected, CheckContinuity3d, CheckVertex, CheckNewVertex, CheckSameParameter.
- MaxDistance2d(): number
Returns the last maximal distance in 2D-UV computed by CheckContinuity2d.
ShapeAnalysis_WireOrder
This class is intended to control and, if possible, redefine the order of a list of edges which define a wire Edges are not given directly, but as their bounds (start,end).
This allows to use this tool, either on existing wire, or on data just taken from a file (coordinates are easy to get)
It can work, either in 2D, or in 3D, or miscible mode The tolerance for each mode is fixed
Two phases : firstly add the couples (start, end) secondly perform then get the result
Constructors(2)
Empty constructor.
- constructor(theMode3D: boolean, theTolerance: number, theModeBoth?: boolean): ShapeAnalysis_WireOrder
Creates a WireOrder. Flag <theMode3D> defines 3D or 2d mode. Flag <theModeBoth> defines miscible mode and the flag <theMode3D> is ignored. Warning: Parameter <theTolerance> is not used in algorithm.
Parameters (3)theMode3DtheTolerancetheModeBoth
Instance methods(21)
- SetMode(theMode3D: boolean, theTolerance: number, theModeBoth?: boolean): void
Sets new values. Clears the edge list if the mode (<theMode3D> or <theModeBoth> ) changes. Clears the connexion list. Warning: Parameter <theTolerance> is not used in algorithm.
Parameters (3)theMode3DtheTolerancetheModeBoth
- Tolerance(): number
Returns the working tolerance.
- Clear(): void
Clears the list of edges, but not mode and tol.
Adds a couple of points 3D (start, end).
Parameters (2)theStart3dtheEnd3d
Adds a couple of points 2D (start, end).
Parameters (2)theStart2dtheEnd2d
Adds a couple of points 3D and 2D (start, end).
Parameters (4)theStart3dtheEnd3dtheStart2dtheEnd2d
- NbEdges(): number
Returns the count of added couples of points (one per edges).
- KeepLoopsMode(): boolean
If this mode is True method perform does not sort edges of different loops. The resulting order is first loop, second one etc...
- Perform(closed?: boolean): void
Computes the better order Optimised if the couples were already in order The criterium is : two couples in order if distance between end-prec and start-cur is less then starting tolerance <tol> Else, the smallest distance is reached Warning: Parameter <closed> not used.
Parameters (1)closed
- IsDone(): boolean
Tells if Perform has been done Else, the following methods returns original values.
- Status(): number
Returns the status of the order (0 if not done) : 0 : all edges are direct and in sequence 1 : all edges are direct but some are not in sequence -1 : some edges are reversed, but no gap remain 3 : edges in sequence are just shifted in forward or reverse manner.
- Ordered(theIdx: number): number
Returns the number of original edge which correspond to the newly ordered number <n> Warning : the returned value is NEGATIVE if edge should be reversed.
Parameters (1)theIdx
Returns the values of the couple <num>, as 3D values.
Parameters (3)theIdxtheStart3D—Mutated in place; read the updated value from this argument after the call.theEnd3D—Mutated in place; read the updated value from this argument after the call.
Returns the values of the couple <num>, as 2D values.
Parameters (3)theIdxtheStart2D—Mutated in place; read the updated value from this argument after the call.theEnd2D—Mutated in place; read the updated value from this argument after the call.
- Gap(num?: number): number
Returns the gap between a couple and its preceding <num> is considered ordered If <num> = 0 (D), returns the greatest gap found.
Parameters (1)num
- SetChains(gap: number): void
Determines the chains inside which successive edges have a gap less than a given value. Queried by NbChains and Chain.
Parameters (1)gap
- NbChains(): number
Returns the count of computed chains.
- Chain(num: number, n1: number, n2: number): { n1: number; n2: number }
Returns, for the chain n0 num, starting and ending numbers of edges. In the list of ordered edges (see Ordered for originals).
Parameters (3)numn1n2
ReturnsA result object with fields:
n1: updated value from the call.n2: updated value from the call.
- SetCouples(gap: number): void
Determines the couples of edges for which end and start fit inside a given gap. Queried by NbCouples and Couple Warning: function isn't implemented.
Parameters (1)gap
- NbCouples(): number
Returns the count of computed couples.
- Couple(num: number, n1: number, n2: number): { n1: number; n2: number }
Returns, for the couple n0 num, the two implied edges In the list of ordered edges.
Parameters (3)numn1n2
ReturnsA result object with fields:
n1: updated value from the call.n2: updated value from the call.
ShapeAnalysis_WireVertex
Analyzes and records status of vertices in a Wire.
The Wire has formerly been loaded in a ShapeExtend_WireData For each Vertex, a status and some data can be attached (case found, position and parameters) Then, these information can be used to fix problems
Constructors(1)
Empty constructor.
Instance methods(24)
- Init(wire: TopoDS_Wire, preci: number): voidParameters (2)
wirepreci
- Init(swbd: ShapeExtend_WireData, preci: number): voidParameters (2)
swbdpreci
- Load(wire: TopoDS_Wire): voidParameters (1)
wire
- Load(sbwd: ShapeExtend_WireData): voidParameters (1)
sbwd
- SetPrecision(preci: number): void
Sets the precision for work Analysing: for each Vertex, comparison between the end of the preceding edge and the start of the following edge Each Vertex rank corresponds to the End Vertex of the Edge of same rank, in the
ShapeExtend_WireData. I.E. for Vertex <num>, Edge <num> is the preceding one, <num+1> is the following one.Parameters (1)preci
- Analyze(): void
- SetSameVertex(num: number): void
Records status "Same Vertex" (logically) on Vertex <num>.
Parameters (1)num
- SetSameCoords(num: number): void
Records status "Same Coords" (at the Vertices Tolerances).
Parameters (1)num
- SetClose(num: number): void
Records status "Close Coords" (at the
Precisionof <me>).Parameters (1)num
<num> is the End of preceding Edge, and its projection on the following one lies on it at the
Precisionof <me> <ufol> gives the parameter on the following edgeParameters (3)numposufol
<num> is the Start of following Edge, its projection on the preceding one lies on it at the
Precisionof <me> <upre> gives the parameter on the preceding edgeParameters (3)numposupre
<num> is the Intersection of both Edges <upre> is the parameter on preceding edge, <ufol> on following edge
Parameters (4)numposupreufol
- SetDisjoined(num: number): void
<num> cannot be said as same vertex
Parameters (1)num
- IsDone(): boolean
Returns True if analysis was performed, else returns False.
- Precision(): number
Returns precision value used in analysis.
- NbEdges(): number
Returns the number of edges in analyzed wire (i.e. the length of all arrays).
Returns analyzed wire.
- Status(num: number): number
Returns the recorded status for a vertex More detail by method Data.
Parameters (1)num
- Parameters (1)
num
- UPrevious(num: number): numberParameters (1)
num
- UFollowing(num: number): numberParameters (1)
num
- Data(num: number, pos: gp_XYZ, upre: number, ufol: number): { returnValue: number; upre: number; ufol: number }
Returns the recorded status for a vertex With its recorded position and parameters on both edges These values are relevant regarding the status: Status Meaning Position Preceding Following 0 Same no no no 1 SameCoord no no no 2 Close no no no 3 End yes no yes 4 Start yes yes no 5 Inters yes yes yes -1 Disjoined no no no.
Parameters (4)numpos—Mutated in place; read the updated value from this argument after the call.upreufol
ReturnsA result object with fields:
returnValue: the C++ return valueupre: updated value from the call.ufol: updated value from the call.
- NextStatus(stat: number, num?: number): number
For a given status, returns the rank of the vertex which follows <num> and has the same status. 0 if no more Acts as an iterator, starts on the first one.
Parameters (2)statnum
- NextCriter(crit: number, num?: number): number
For a given criter, returns the rank of the vertex which follows <num> and has the same status. 0 if no more Acts as an iterator, starts on the first one Criters are: 0: same vertex (status 0) 1: a solution exists (status >= 0) 2: same coords (i.e. same params) (status 0 1 2) 3: same coods but not same vertex (status 1 2) 4: redefined coords (status 3 4 5) -1: no solution (status -1).
Parameters (2)critnum