Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2024.
|
Provide triangular mesh edition and creation methods. More...
Public Member Functions | |
Object | BooleanAdd (SPoly poly) |
Make a boolean addition with the current SPoly. More... | |
Object | BooleanCommon (SPoly poly) |
Get the boolean common part between two closed volumes (the current object and a given SPoly). More... | |
Object | BooleanCutIn (SPoly poly) |
Cut the current SPoly against the parameter SPoly and keep the part of the current SPoly that is inside the parameter SPoly. More... | |
Object | BooleanCutOut (SPoly poly) |
Cut the current SPoly against the parameter SPoly and keep the part of the current SPoly that is outside the parameter SPoly. More... | |
Object | BooleanOperation (SPoly poly, boolean isCutPoly=false) |
Make a boolean operation between two SPoly. More... | |
Object | BooleanSub (SPoly poly) |
Make a boolean subtraction with the current object. More... | |
Clear () | |
Deallocate memory of the object. More... | |
Object | Compare (SCloud measCloud, number distMax, number mappingObject=1, boolean isIgnoreEdge=false, SVector direction=null, number maxCosAngle=-2, boolean isCheckForThinParts=false) |
Compute the distances between 2 components for further inspection purpose (color mapping) More... | |
Object | Compare (SPoly measPoly, number distMax, number mappingObject=1, boolean isIgnoreEdge=false, SVector direction=null, number maxCosAngle=0, boolean isCheckForThinParts=false) |
Compute the distances between 2 SPoly for further inspection purpose (color mapping) More... | |
Object | ConstraintMesh3D (SCloud cloudOfPoints, Array< SMultiline > setOfMultilines, number tolerance, number zoneType) |
Make a 3D meshing on a mesh (this), an array of SMultiline and a point cloud; both are optional but at least one is necessary to add points on the mesh! More... | |
Object | Cubature (SPoly secondPoly, SVector projDir=SVector()) |
Compute volumes between 2 surfaces to make cubature of embankments and excavations. This function makes the volume computation according to the projection direction projDir. If the projection direction is null, the function will try to evaluate this direction. 2 volumes are computed: volume over Poly0 and under Poly1 (side 1), volume under Poly0 and over Poly1 (side 2) More... | |
Object | Explode () |
Explode a compound SPoly into several parts. More... | |
Object | ExplodeColor () |
Explode a compound mesh into several parts according to the color of the triangles. More... | |
Object | ExplodeWithInspectionSteps () |
Split the mesh according to the inspection steps. More... | |
Object | ExtractCylinder (Array< SPoint > seedPoint, number tolerance, CylinderEnum force=SPoly.CYL_FORCE_NOTHING, SPoint center=null, SVector directionVector=SVector(), number radius=0) |
Extract the cylindrical region on the current SPoly starting from seed points. More... | |
Object | ExtractFeatureLines (number smoothingIntensity=0) |
Extract all the feature lines on the SPoly. More... | |
Object | ExtractLine (SPoint seedPoint, number tolerance, LineEnum force=SPoly.LINE_FORCE_NOTHING, SPoint passingPoint=SPoint(), SVector directionVector=SVector()) |
Extract the line on the current polyhedron, starting from seed point(s). More... | |
Object | ExtractPlane (SPoint seedPoint, number tolerance) |
Extract the planar region on the current SPoly starting from a seed point. More... | |
Object | ExtractSphere (Array< SPoint > seedPoint, number tolerance, SphereEnum force=SPoly.SPHERE_FORCE_NOTHING, SPoint center=null, number radius=0) |
Extract the spherical region on the current SPoly starting from seed points. More... | |
Object | FillContours (Array< SMultiline > contourTable, number tension=0.732, number wallThickness=-1, boolean isForceNonSmoothShape=false) |
3D Hole filling. Create triangles on the edges of the holes to fill the concave parts. More... | |
Object | FillHoles (Array< SPoint > pointTable, number tension=0, number wallThickness=-1) |
3D Hole filling. Create triangles on the edges of the holes to fill the concave parts. The contours to be treated are selected with a point on the contour. More... | |
Object | FillHolesDirection (SVector direction, Array< SPoint > pointTable, number tension=0) |
Fill the holes that have at least one point listed in the table of points. More... | |
Object | GetColorGradient () |
Get the color gradient of the SPoly. More... | |
Object | GetContours () |
Extract free contour(s) from the current SPoly. More... | |
Object | GetHighestPoint (SVector direction) |
Get the highest point according to the given direction. More... | |
Object | GetInertiaMatrix (boolean doStopIfClosed=true) |
Compute the solid's inertia matrix. More... | |
Object | GetLowestPoint (SVector direction) |
Get the lowest point according to the given direction. More... | |
number | GetNbPieces () |
Return the number of independent pieces inside the SPoly. More... | |
Object | GetSilhouette (SVector viewDirection, number draftAngle, number minClosedLine, number minUnclosedLine, number resultType) |
Compute the silhouette or external contour of a SPoly according to a direction and possibly a draft angle. More... | |
Object | GetSurface () |
Retrieve the SPoly's surface. More... | |
Object | GetTriangleSize () |
Retrieve the size of the smallest and biggest triangle of the current SPoly. The size of a triangle is the size of its longest edge. More... | |
number | GetTrianglesNumber () |
Get the number of triangles of the SPoly. More... | |
Object | GetVolume (boolean isOnlyIfClosed=true) |
Retrieve the SPoly's volume. More... | |
Object | InterInfLine (SPoint point, SVector vect) |
Compute the intersection with an infinite line. More... | |
Object | Intersect (SPoly poly, number option) |
Make an intersection between two objects (the current object and a given parameter). More... | |
Object | LoadColorGradient (string filePath) |
Load the color gradient from a file (*.rsi binary file). More... | |
Object | LocalizeValues (Array< number > thresholdList) |
Extract the points or the lines at threshold values of an inspected mesh. More... | |
Object | MeshSegmentation (number angleThreshold=15, number mergeMaxDistance=0, number minRegionArea=0, number classificationMaxDistance=0, SegmentationFeaturesEnum featuresOption=SPoly.SEGMENTATION_All) |
Segment a mesh in several regions matching with geometric features (SPlane, SSphere, SCylinder and SCone). The algorithm relies on region growing mechanism and works in two steps: 1 - Create small regions from triangles sharing almost the same normals (according to angleThreshold). 2 - Merge similar regions sharing geometric properties. More... | |
Object | Offset (boolean isDirect, number distCoef, OffsetEnum option=SPoly.NORMAL_OFFSET) |
Compute and return a new parallel SPoly. More... | |
Object | Proj3D (SMultiline multilineToProject, boolean addIntermediatePt=true) |
Compute the 3D projection of a SMultiline on a SPoly. More... | |
Object | Proj3D (SPoint point) |
Compute the 3D projection of a SPoint on a SPoly. This function always returns the nearest point. More... | |
Object | ProjDir (SMultiline multilineToProject, SVector direction, boolean addIntermediatePt=true, boolean isSignedProjection=false) |
Compute the projection of a SMultiline on a SPoly with a direction. More... | |
Object | ProjDir (SPoint point, SVector direction, boolean isSignedProjection=false) |
Compute the projection of a SPoint on a SPoly with a direction. The point to project is considered as the origin of the direction. More... | |
Object | Reduce (number targetNbVertex, number minAngle) |
Reduce a mesh according to the angle between facets to minimize the visual degradation. More... | |
Object | ReduceDeviation (number deviationError, DeviationOptionEnum criteria, boolean isSharpEdgeKept=false, number deviationOnSharpEdges=0, number sharpEdgeAngleValue=0, number maxEdgeLength=0, number deviationOnBorders=0) |
Reduce the SPoly by deleting some vertices and triangles according to a deviation error. More... | |
Object | RemeshRefineDev (number deviation, number sizeMin, number maxiTriNumber, BordersEnum borderOption, number distanceWrongPoints, number reorganize, SCloud cloud=null, number maxCosAngle=-1) |
Refine an existing SPoly with deviation error and optionally better fitting on a SCloud. More... | |
Object | RemeshSharpEdge (Array< SMultiline > lines, SPoint referencePoint) |
Modify locally the existing mesh to recreate sharp edge(s) More... | |
Object | RemoveSpikes (number loopNumber=1, number propag=-1, number intensity=1, boolean isRecomputeBorder=true) |
Suppress or correct absurd points (i.e. spikes) of the current SPoly. More... | |
Object | RemoveTrianglesOnHoles (SCloud cloud, number holeSize, number maxDistToCloud=-1, number maxAngle=-1) |
Remove triangles which are considered to be over a hole of a certain diameter regarding 'cloud'. More... | |
Object | Save (string filePath, boolean isTextExport=false, SMatrix coordinateSystemMatrix=SMatrix()) |
Save the mesh into a file. More... | |
Object | SaveColorGradient (string filePath) |
Save the color gradient into a file (*.rsi binary file). More... | |
Object | SectionCylindric (SPoint firstPointOnAxis, SPoint secondPointOnAxis, SPoint pointOnTheFirstCylinder, number numberOfCylinders, number distancebetweenCylinders) |
Compute the intersection of a SPoly with parallel cylinders. More... | |
Object | SectionOnMulti (SMultiline multiLine, Array< number > listDist, number maxDist, number optBitMask=0) |
Compute the sections of a SPoly (for example a tube or a tunnel) along a SMultiline (normal to the SMultiline). We take points on the neutral axis which are regularly distributed according to a curvilinear distance. More... | |
Object | SectionOnMultiReg (SMultiline multiLine, number dist, number maxDist, number optBitMask=0) |
Compute the sections of a SPoly (for example a tube or a tunnel) along a SMultiline (normal to the SMultiline). We take a list of curvilinear distances. More... | |
Object | SectionPlane (SVector planeNormal, SPoint ptFirstPlane, number nbPlanes, number distance) |
Compute the intersection between a SPoly and a parallel plane. More... | |
Object | SectionRadial (SPoint firstPointOnAxis, SPoint secondPointOnAxis, SPoint ptFirstPlane, number nbSections, number maxAngleInRadian) |
Compute the intersection of a SPoly by radial planes. More... | |
Object | SeparateTriangleBox (SPoint lowerPoint, SPoint upperPoint, SeparateTriBoxEnum selType, SeparateTriBoxSelectEnum whichPartToKeep) |
Separate triangles of a SPoly according to a box. Depending of whichPartToKeep, the current SPoly is updated and Array.Poly can be fill also (case of SEPARATETRIBOX_KEEP_BOTH). More... | |
Object | SeparateTriangleInPrism (SMultiline profil, number distance, SeparateTriBoxEnum selType, SeparateTriBoxSelectEnum whichPartToKeep) |
Separate triangles of a SPoly according to a prism. Depending of iWhichPartToKeep, the current SPoly is updated and Array.Poly can be fill also (case of SEPARATETRIBOX_KEEP_BOTH). The prism is created by a given planar profile and is extruded on both sides using given distance/2. More... | |
Object | SeparateTriangleSize (number smallestSize, number biggestSize) |
Separate a SPoly into parts according to the triangle size. More... | |
Object | SeparateTriangleWithActivatedClippingPlanes (Array< SClippingPlane > clippingPlanes, SeparateTriBoxEnum selType) |
Separate triangles of a mesh according to clipping planes. Depending of iWhichPartToKeep, the current SPoly is updated and Array.Poly can be fill also (case of SEPARATETRIBOX_KEEP_BOTH). More... | |
Object | SetBorders (Array< SMultiline > multiTbl, number remeshDistance) |
Create a new SPoly by updating the input one in order to make it fit the input border. More... | |
SetPolyRepresentation (PolyRepresentationTypeEnum representation) | |
Set the representation of the SPoly. More... | |
Object | Smooth (number loopNumber, SmoothEnum option, number maxiDeviation, boolean isReorganise, number minAngleReorg, number refineDistProj=-1, number refineVrtxAngle=-1, number angleSharpEdge=-1, number nbTriMax=-1) |
Smooth the surface of the current SPoly. More... | |
Object | SmoothBorders (Array< SPoint > pointTable, number maxEdgeLength=0) |
3D smoothing of borders. The function creates triangles on the edges of the holes to create smooth borders. The borders to be treated are selected with a point on the borders. More... | |
SPoly () | |
Default constructor to create an empty new SPoly. More... | |
SPoly (SPoly other) | |
Constructs a SPoly by copying the SPoly other. More... | |
Object | StitchOverlap (SPoly meshToStitch, number tolDist, StitchOverlapEnum options) |
Stitch a SPoly (meshToStitch) with the current SPoly. More... | |
Object | SubdivideTriangles (number maxEdgeLength, boolean ignoreFreeEdges=false, number limitCos=0, boolean preserveGeometry=false) |
Subdivide triangles when at least one of its edges is longer than the maximum allowed edge length. More... | |
Object | Tolerance3DMesh (SCloud cloud, number deviation, number distanceWrongPoints, number sizeTriMax, boolean isReorganize, number extension, boolean isNoiseReduct) |
Upgrade the current SPoly by using its topology. More... | |
string | toString () |
Get the type of the variable. More... | |
string | ValuesToString () |
Get a debug string representation of the poly. More... | |
Object | VolumeFromElevation (Array< number > elevations, SVector projDir=SVector()) |
Compute the volume of the SPoly above and below the given elevation. More... | |
Object | WriteOnMesh (string textToWrite, SVector textNormal, SVector textHorizontalNormal, SPoint textPosition, number textDepth, number planeDepth, number scale, string font="Arial", boolean isBold=false, boolean isItalic=false, number writingStyle=1) |
Write a text on a mesh. The mesh will be engraved. More... | |
Public Member Functions inherited from SComp | |
AddToDoc () | |
Add the object to the document. More... | |
ApplyTransformation (SMatrix matrix) | |
Apply a geometric transformation to the current object by making a product with the given matrix. More... | |
Object | GetBoundingBox (SMatrix ucs=null) |
Calculate the bounding box of the object. More... | |
Object | GetColors () |
Get the colors of the object. More... | |
string | GetFolderName () |
Get the name of the folder containing the object. More... | |
string | GetName () |
Return the object's name. More... | |
string | GetPath () |
Return the full path of a SComp in the tree. More... | |
Invert () | |
Invert the normal of the object. More... | |
boolean | IsInDoc () |
Return if the object is in the document or not. More... | |
boolean | IsVisible () |
Get the visibility of the object. More... | |
MoveToGroup (string groupPath, boolean moveInsideTopParent=true) | |
Move the object to the document group represent by the given path. If some groups, in the path, don't exist, they will be created. More... | |
RemoveFromDoc () | |
Remove the object from the document. More... | |
SetClippable (boolean clipping) | |
Set clippable or not. More... | |
SetColors (number red, number green, number blue) | |
Set the colors of the object. More... | |
SetName (string objectName) | |
Set the object's name. More... | |
SetTransparency (number alpha) | |
Set the transparency of the object. More... | |
SetVisibility (boolean visible) | |
Set the object to be visible, or not visible. More... | |
string | toString () |
Get the type of the variable. More... | |
Translate (SVector vector) | |
Make a translation of the current object with an SVector. More... | |
Static Public Member Functions | |
static Array< SPoly > | All (VisibilityEnum visCrit=SComp.ANY_VISIBILITY) |
Get all the SPoly in the document. More... | |
static Object | ColorAlongDir (Array< SPoly > polys, SVector directionVect, SPoint origin=null) |
Color the SPoly along a direction with a gradient. More... | |
static Object | ConstraintMesh2D (SCloud cloudOfPoints, Array< SMultiline > setOfMultilines, SVector meshDir, number tolerance, number zoneType) |
Make a 2D1/2 meshing on an array of SMultiline and a point cloud; both are optional but at least one is necessary! More... | |
static Object | CreateCompound (Array< SPoly > tablePoly, boolean optOrient=false) |
Make a compound SPoly from a table of SPoly. More... | |
static Object | Direct3DMesh (SCloud cloudToMesh, number deviationError, number minAverageDist, HoleOptionEnum optionHole, number sizeTriHole, boolean isScanDirIgnored=false, number iSmoothingDistanceFactor=0) |
Make a direct 3D mesh of a SCloud according to different strategies (regular, deviation, etc.). More... | |
static Object | DirectionMesh (SCloud cloudOfPoints, SVector meshingDirection, number tolerance, boolean isFindContour=false) |
Mesh a cloud of points according to a certain tolerance and direction (2D1/2 meshing) More... | |
static Object | Extrusion (SMultiline profile, SMultiline path, boolean turnWithPath=true, boolean perpendicularToPath=true, SMultiline secondPath=null, RotateEnum option=SPoly.ROTATE_AUTO, SPoint rotatePt=null) |
Create a mesh from a path and a profile, the profile is extracted along the path. More... | |
static Object | FromClick () |
Launch an interaction to select a SPoly in the scene. More... | |
static Object | FromFile (string fileName) |
Import a set of meshes from a file and create the associated SPoly objects. More... | |
static Array< SPoly > | FromName (string name) |
Search all the SPoly with the given name. More... | |
static Array< SPoly > | FromSel () |
Get all the selected SPoly. More... | |
static Object | Fusion (Array< SPoly > polyTable, FusionOptionEnum option, number accuracyPoint=1e-05, number accuracyBorders=0.001) |
Sew common edges of a SPoly list, or rebuild topology of existing SPoly. More... | |
static Object | JoinContour (Array< SMultiline > multiLines, Array< SPoly > polyhedrons, number tangency1=0, number tangency2=0, number tension=0.732, boolean reorganize=false, number nbPoint=0) |
Create a meshed surface from two contours or mesh holes, which optionally preserves tangency continuity. More... | |
static Object | LinearExtrusion (number length, SVector direction, boolean closeExtremities, Array< SComp > comps) |
Compute poly(s) corresponding to the extrusion of profile(s) (SMultiline, linear SFeature, linear SShape object) along a direction, with a given length. More... | |
static Object | MergeCommonBorders (Array< SPoly > polyTable, FusionOptionEnum option, number accuracyPoint=1e-05, number accuracyBorders=0.001) |
Sew common edges of a SPoly list, or rebuild topology of existing SPoly. More... | |
static SPoly | New () |
Default constructor to create an empty new SPoly. More... | |
static SPoly | New (SPoly other) |
Constructs a SPoly by copying the SPoly other. More... | |
static Object | PipeTubeAlongPath (number radius, boolean closeExtremities, Array< SComp > comps) |
Compute SPoly corresponding to the extrusion of a circle with a given radius along a given path. More... | |
static Object | ProfileAlongPath (SComp profile, SComp path, boolean makePerpendicular, boolean turnWthCurve, boolean usePathToLeanOn, boolean startAtProfilePosition, boolean closeExtremities, SComp pathToLeanOn) |
Compute the SPoly corresponding to the extrusion of a given profile along a given path. More... | |
static Object | ProfileAlongPath (SComp profile, SComp path, boolean turnWthPath, SPoint profileBasePoint, SComp leanPath, SPoint profileLeanPoint, boolean closeExtremities) |
Compute the SPoly corresponding to the extrusion of a given profile along a given path. More... | |
static number | SaveFBX (string filePath, Array< SPoly > meshesToExport, boolean isExportTexture=false, EExportVertexColor exportVertexColor=SPoly.EXPORT_FBX_NO_COLOR, SMatrix coordinateSystemMatrix=SMatrix()) |
Save the SPoly(s) into a FBX file. More... | |
static Object | ScanToMesh (SCloud cloud, number boxSize, number averagePointDistance, number minTriangleSize, number texturePixelSize=0.01, boolean ignoreScanDir=false) |
Compute a SPoly from a scanned data by specifying meshing parameters. More... | |
static Object | ScanToMesh (SCloud cloud, ScannerType scannerType, boolean textureFromCloud, boolean ignoreScanDir=false) |
Compute a SPoly from a scanned data by specifying the scanner type. More... | |
static Object | ScanToMesh (SCwCloud cloud, number boxSize, number averagePointDistance, number minTriangleSize, number texturePixelSize=0.01, boolean ignoreScanDir=false) |
Compute a SPoly from a scanned data by specifying meshing parameters. More... | |
static Object | ScanToMesh (SCwCloud cloud, ScannerType scannerType, boolean textureFromCloud, boolean ignoreScanDir=false) |
Compute a SPoly from a scanned data by specifying the scanner type. More... | |
static Object | SphericalMesh (Array< SCloud > cloudOfPoints, SPoint scanPos, number regularSampling, number deviationErr, number maxiNbTriangle, number alphaShapeThreshold, number maxSizeThreshold, number minSizeThreshold, number deleteSmall) |
Make a spherical 3D mesh from SCloud(s) More... | |
Static Public Member Functions inherited from SComp | |
static Array< SComp > | All (VisibilityEnum visCrit=SComp.ANY_VISIBILITY) |
Get all the SComp in the document. More... | |
static Object | FromClick () |
Launch an interaction to select a SComp in the scene. More... | |
static Array< SComp > | FromName (string name) |
Search all the SComp with the given name. More... | |
static Array< SComp > | FromSel () |
Get all the selected SComp. More... | |
Provide triangular mesh edition and creation methods.
enum SPoly::BordersEnum |
What should be done with free borders?
Enumerator | |
---|---|
NO_CHANGE | Don't change free edges (borders) |
REFINE | Refine free edges. |
EXTEND_REFINE | Extend (if some cloud points are outside free borders) and refine free edges. The extension value is 'distanceWrongPoints', if not zero or the average triangle size of the current SPoly. |
enum SPoly::CylinderEnum |
Which parameter(s) are forced and do not need to be computed?
The reduction options.
Option for the fusion.
Enumerator | |
---|---|
SIMPLE | Simple fusion without any modification. |
REMESH | If parallel free contour are found try to re-mesh locally to merge them. |
FILL_HOLES | Try to fill all the holes except the biggest one (free border). |
CLOSE | Try to close the SPoly. |
How holes should be treated?
Enumerator | |
---|---|
NO_CLOSED | Try to detect all the holes. |
INSIDE_CLOSED | Detect the outside border and fill the inside holes (only one free border). There is no warranty that the result will exactly correspond to you wish. See remark that follows. |
ALL_CLOSED | Try to close the SPoly (watertight mesh). As the word "try" suggests, there is no warranty that the mesh will be closed if you use this option. When you select this option, the software will only fill the holes that can be filled without creating an absurd shape. In particular, if the software finds some very sharp angles or surface auto-intersection or reversed normals the function will refuse to close and the mesh will remain open. If you want to increase the probability to obtain a closed mesh, you should use SPoly.FillHoles(), which provides an option to fill the holes "unconditionally". |
enum SPoly::LineEnum |
Enum to know which parameter(s) are forced and do not need to be computed.
enum SPoly::OffsetEnum |
The different representation types for SPoly.
enum SPoly::RotateEnum |
enum SPoly::ScannerType |
Which features must be extracted?
The option to know which part has to be kept.
Enumerator | |
---|---|
SEPARATETRIBOX_KEEP_INSIDE_TRI | Update the current SPoly and keep only triangles inside the box (or only triangles crossing the box). |
SEPARATETRIBOX_KEEP_OUTSIDE_TRI | Update the current SPoly and Keep only unselected triangles. |
SEPARATETRIBOX_KEEP_BOTH | Keep both parts, the current SPoly will be made with unselected triangles, the selected triangles will be put inside the output. |
enum SPoly::SmoothEnum |
The options for SPoly.Smooth()
enum SPoly::SphereEnum |
Stitching options.
SPoly::SPoly | ( | ) |
Default constructor to create an empty new SPoly.
SPoly::SPoly | ( | SPoly | other | ) |
|
static |
Get all the SPoly in the document.
visCrit | (VisibilityEnum) Visible selection criteria
|
Object SPoly::BooleanAdd | ( | SPoly | poly | ) |
Object SPoly::BooleanCommon | ( | SPoly | poly | ) |
Get the boolean common part between two closed volumes (the current object and a given SPoly).
ret.ErrorCode | (number) The error code
|
ret.PolyTbl | (Array<SPoly>) The boolean operation's result. |
Object SPoly::BooleanCutIn | ( | SPoly | poly | ) |
Cut the current SPoly against the parameter SPoly and keep the part of the current SPoly that is inside the parameter SPoly.
ret.ErrorCode | (number) The error code
|
ret.PolyTbl | (Array<SPoly>) The boolean operation's result. |
Object SPoly::BooleanCutOut | ( | SPoly | poly | ) |
Cut the current SPoly against the parameter SPoly and keep the part of the current SPoly that is outside the parameter SPoly.
ret.ErrorCode | (number) The error code
|
ret.PolyTbl | (Array<SPoly>) The boolean operation's result. |
Object SPoly::BooleanOperation | ( | SPoly | poly, |
boolean | isCutPoly = false |
||
) |
Make a boolean operation between two SPoly.
poly | (SPoly) The second SPoly |
isCutPoly | (boolean) if true, make a cut of this against SPoly (No facet of SPoly is output in result). |
ret.ErrorCode | (number) The error code
|
ret.PolyTbl | (Array<SPoly>) The boolean operation's result. |
Object SPoly::BooleanSub | ( | SPoly | poly | ) |
Make a boolean subtraction with the current object.
ret.ErrorCode | (number) The error code
|
ret.PolyTbl | (Array<SPoly>) The boolean operation's result. |
SPoly::Clear | ( | ) |
Deallocate memory of the object.
|
static |
Color the SPoly along a direction with a gradient.
Object SPoly::Compare | ( | SCloud | measCloud, |
number | distMax, | ||
number | mappingObject = 1 , |
||
boolean | isIgnoreEdge = false , |
||
SVector | direction = null , |
||
number | maxCosAngle = -2 , |
||
boolean | isCheckForThinParts = false |
||
) |
Compute the distances between 2 components for further inspection purpose (color mapping)
measCloud | (SCloud) SCloud considered as the measured object to project on this |
distMax | (number) Ignore point having a distance greater than distMax. |
mappingObject | (number) Choose the object to color.
|
isIgnoreEdge | (boolean) What should be done with points on edges?
|
direction | (SVector) The direction of the inspection. Use null to do a 3D inspection. |
maxCosAngle | (number) The max cos value for the angle between the triangle and the scanning direction if the cloud contains scanning direction, this parameter can be used to reject points whose scanning direction is not valid according to this threshold.
|
isCheckForThinParts | (boolean) Does the cloud contains thin parts scanned from both sides? This option is only valid if the cloud contains scanning direction and maxCosAngle>-2
|
ret.ErrorCode | (number) The error code
|
ret.Cloud | (SCloud) The new SCloud, which is the result of the comparison, if mappingObject is set to 2. |
ret.Poly | (SPoly) The new SPoly, which is the result of the comparison, if mappingObject is set to 1. |
ret.ReportData | (SReportData) The new SReportData, which contains the view set with the inspected component. |
Object SPoly::Compare | ( | SPoly | measPoly, |
number | distMax, | ||
number | mappingObject = 1 , |
||
boolean | isIgnoreEdge = false , |
||
SVector | direction = null , |
||
number | maxCosAngle = 0 , |
||
boolean | isCheckForThinParts = false |
||
) |
Compute the distances between 2 SPoly for further inspection purpose (color mapping)
measPoly | (SPoly) The SPoly considered as the measured object to project on this |
distMax | (number) Ignore point having a distance greater than this one. |
mappingObject | (number) Choose the object to color.
|
isIgnoreEdge | (boolean) What should be done with points on edges?
|
direction | (SVector) The direction of the inspection. Use null to do a 3D inspection. |
maxCosAngle | (number) The max cos value for the angle between the triangle normal of each mesh. This parameter can be used to reject triangles whose angle between normals is not valid according to this threshold.
|
isCheckForThinParts | (boolean) Does the mesh contains thin parts? This option is only valid if maxCosAngle>-2
|
ret.ErrorCode | (number) The error code
|
ret.Poly | (SPoly) The new SPoly, which is the result of the comparison. |
ret.ReportData | (SReportData) The new SReportData, which contains the view set with the inspected component. |
|
static |
Make a 2D1/2 meshing on an array of SMultiline and a point cloud; both are optional but at least one is necessary!
cloudOfPoints | (SCloud) The cloud of points to mesh or 0 |
setOfMultilines | (Array<SMultiline>) Set of contours to merge and mesh with the cloud or an empty table if no contour to insert in the constrain meshing. |
meshDir | (SVector) This vector defines the meshing direction for which all the points, triangles and contours are visible. |
tolerance | (number) The tolerance to respect ; deviation error (for the points of the cloud only). |
zoneType | (number) Defines which type of result must be output.
|
Object SPoly::ConstraintMesh3D | ( | SCloud | cloudOfPoints, |
Array< SMultiline > | setOfMultilines, | ||
number | tolerance, | ||
number | zoneType | ||
) |
Make a 3D meshing on a mesh (this), an array of SMultiline and a point cloud; both are optional but at least one is necessary to add points on the mesh!
cloudOfPoints | (SCloud) The cloud of points to mesh or null |
setOfMultilines | (Array<SMultiline>) Set of contours to merge and mesh with the cloud or an empty table if no contour to insert in the constrain meshing. |
tolerance | (number) The tolerance to respect ; deviation error (for the points of the cloud only). |
zoneType | (number) Defines which type of result must be output.
|
|
static |
Make a compound SPoly from a table of SPoly.
Compute volumes between 2 surfaces to make cubature of embankments and excavations. This function makes the volume computation according to the projection direction projDir. If the projection direction is null, the function will try to evaluate this direction. 2 volumes are computed: volume over Poly0 and under Poly1 (side 1), volume under Poly0 and over Poly1 (side 2)
secondPoly | (SPoly) The second SPoly |
projDir | (SVector) The projection direction or null if none |
ret.ErrorCode | (number) The error code
|
ret.ValueTbl | (Array<number>) [0] Volume over current mesh and under secondPoly (side 1) [1] Volume under current mesh and over secondPoly (side 2) |
|
static |
Make a direct 3D mesh of a SCloud according to different strategies (regular, deviation, etc.).
cloudToMesh | (SCloud) The SCloud to mesh |
deviationError | (number) The deviation error ( tolerance ) to respect. |
minAverageDist | (number) The noise reduction strategy
|
optionHole | (HoleOptionEnum) How holes should be treated?
|
sizeTriHole | (number) The maximum length of triangles to fill holes. (-1 if no limit.) |
isScanDirIgnored | (boolean) Ignore scan directions when meshing |
iSmoothingDistanceFactor | (number) The factor multiplying the minAverageDist parameter to smooth/denoise locally the surface. |
|
static |
Mesh a cloud of points according to a certain tolerance and direction (2D1/2 meshing)
Object SPoly::Explode | ( | ) |
Object SPoly::ExplodeColor | ( | ) |
Object SPoly::ExplodeWithInspectionSteps | ( | ) |
Split the mesh according to the inspection steps.
ret.ErrorCode | (number) The error code:
|
ret.PolyTbl | (Array<SPoly>) The resulting list of components. |
Object SPoly::ExtractCylinder | ( | Array< SPoint > | seedPoint, |
number | tolerance, | ||
CylinderEnum | force = SPoly.CYL_FORCE_NOTHING , |
||
SPoint | center = null , |
||
SVector | directionVector = SVector() , |
||
number | radius = 0 |
||
) |
Extract the cylindrical region on the current SPoly starting from seed points.
seedPoint | (Array<SPoint>) All seed points around which the cylindrical region should be extracted. |
tolerance | (number) The tolerance used for extraction. Extracts only the region that is inside the tolerance. That is to say: only the vertices whose distance with the ideal cylinder is less than this threshold. |
force | (CylinderEnum) Enum to know which parameter(s) is forced or initialized (initializing the computation provides a faster computation).
|
center | (SPoint) The first point of the center line. |
directionVector | (SVector) The normed normal vector of the cylinder. |
radius | (number) The radius of the cylinder to force |
Object SPoly::ExtractFeatureLines | ( | number | smoothingIntensity = 0 | ) |
Extract all the feature lines on the SPoly.
smoothingIntensity | (number) Between 0 and 1, this parameter allows to limit smoothing intensity (0 = no smoothing) |
ret.ErrorCode | (number) The error code
|
ret.SetMultiTbl | (Array<SSetMultiline>) A table of SSetMultiline containing successively the convex (item 0) and concave lines (item 1). |
Object SPoly::ExtractLine | ( | SPoint | seedPoint, |
number | tolerance, | ||
LineEnum | force = SPoly.LINE_FORCE_NOTHING , |
||
SPoint | passingPoint = SPoint() , |
||
SVector | directionVector = SVector() |
||
) |
Extract the line on the current polyhedron, starting from seed point(s).
seedPoint | (SPoint) Seed point around which the line should be extracted. |
tolerance | (number) Extract only the region that is inside the tolerance, that is: only the vertices whose distance with the ideal line is less than this threshold. |
force | (LineEnum) Enum to know which parameter(s) are forced and do not need to be computed.
|
passingPoint | (SPoint) A passing point of the line |
directionVector | (SVector) The normed direction of the line. |
Object SPoly::ExtractPlane | ( | SPoint | seedPoint, |
number | tolerance | ||
) |
Extract the planar region on the current SPoly starting from a seed point.
seedPoint | (SPoint) The seed point around which the planar region should be extracted. |
tolerance | (number) The tolerance used for extraction. Extract only the region that is inside the tolerance. That is to say: only the vertices whose distance with the ideal plane is less than this threshold. |
Object SPoly::ExtractSphere | ( | Array< SPoint > | seedPoint, |
number | tolerance, | ||
SphereEnum | force = SPoly.SPHERE_FORCE_NOTHING , |
||
SPoint | center = null , |
||
number | radius = 0 |
||
) |
Extract the spherical region on the current SPoly starting from seed points.
seedPoint | (Array<SPoint>) Seed points around which the spherical region should be extracted. |
tolerance | (number) The tolerance used for extraction. Extract only the region that is inside the tolerance. That is to say: only the vertices whose distance with the ideal sphere is less than this threshold. |
force | (SphereEnum) Option to know which parameter(s) is forced
|
center | (SPoint) The center of the sphere to force |
radius | (number) Radius of the sphere to force |
|
static |
Create a mesh from a path and a profile, the profile is extracted along the path.
profile | (SMultiline) The SMutliline that defines the profile. It can be closed or not. |
path | (SMultiline) The SMutliline that defines the path to follow. |
turnWithPath | (boolean) If true, the profile turns with the path |
perpendicularToPath | (boolean) If true, the profile will be computed perpendicular to the path |
secondPath | (SMultiline) The second path to follow, profile orientation will be attracted by this second path This option is not compatible with "turnWithPath = false" |
option | (RotateEnum) How the extrusion rotate point is computed?
|
rotatePt | (SPoint) The profile rotate point (if option set to ROTATE_USER_DEFINE). Take a look on the picture below |
Object SPoly::FillContours | ( | Array< SMultiline > | contourTable, |
number | tension = 0.732 , |
||
number | wallThickness = -1 , |
||
boolean | isForceNonSmoothShape = false |
||
) |
3D Hole filling. Create triangles on the edges of the holes to fill the concave parts.
contourTable | (Array<SMultiline>) The table of contours to process |
tension | (number) The tension of the surface to generate
|
wallThickness | (number) The wall thickness to allow better filling of horseshoe holes going on two sides of a wall; -1 if no wall thickness. |
isForceNonSmoothShape | (boolean) Fill unconditionally even if the shape is not smooth and there is a risk to create an absurd shape |
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) A table of contours not filled (empty if no error). |
Object SPoly::FillHoles | ( | Array< SPoint > | pointTable, |
number | tension = 0 , |
||
number | wallThickness = -1 |
||
) |
3D Hole filling. Create triangles on the edges of the holes to fill the concave parts. The contours to be treated are selected with a point on the contour.
pointTable | (Array<SPoint>) A table of points to identify each contour to process |
tension | (number) The tension of the surface to generate
|
wallThickness | (number) The wall thickness to allow better filling of horseshoe holes going on two sides of a wall; -1 if no wall thickness. |
ret.ErrorCode | (number) The error code
|
Object SPoly::FillHolesDirection | ( | SVector | direction, |
Array< SPoint > | pointTable, | ||
number | tension = 0 |
||
) |
Fill the holes that have at least one point listed in the table of points.
direction | (SVector) Direction defining the view of the hole. If null, the direction will be approximated. |
pointTable | (Array<SPoint>) A table of points to identify one of the points of each hole to fill. If empty, all the holes are treated. |
tension | (number) Tension of the surface to generate in the case of complete hole filling
|
ret.ErrorCode | (number) The error code
|
|
static |
Launch an interaction to select a SPoly in the scene.
|
static |
Import a set of meshes from a file and create the associated SPoly objects.
fileName | (string) The file name path |
|
static |
|
static |
|
static |
Sew common edges of a SPoly list, or rebuild topology of existing SPoly.
polyTable | (Array<SPoly>) The SPoly table to fusion. |
option | (FusionOptionEnum) Option for the fusion.
|
accuracyPoint | (number) Accuracy between vertices (distance under which two points are considered identical); Most often 1.E-5 |
accuracyBorders | (number) Accuracy between parallel borders (distance under which two free borders are sewed) |
Object SPoly::GetColorGradient | ( | ) |
Get the color gradient of the SPoly.
ret.ErrorCode | (number) The error code
|
ret.Gradient | (SColorGradient) The SColorGradient associated to the SPoly |
Object SPoly::GetContours | ( | ) |
Extract free contour(s) from the current SPoly.
Returns a table of SMultilines containing all the free edges of a SPoly.
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) A table of Multiline sorted by size (number of points) biggest first; smallest end.Or an empty table if there is no hole and (or) free contour (closed surface). |
Object SPoly::GetHighestPoint | ( | SVector | direction | ) |
Object SPoly::GetInertiaMatrix | ( | boolean | doStopIfClosed = true | ) |
Compute the solid's inertia matrix.
doStopIfClosed | (boolean) Should we stop volume calculation if the surface is not closed? Caution, if false, an approximate result is returned, which may be totally wrong in the case of "big" holes. |
Object SPoly::GetLowestPoint | ( | SVector | direction | ) |
number SPoly::GetNbPieces | ( | ) |
Return the number of independent pieces inside the SPoly.
Object SPoly::GetSilhouette | ( | SVector | viewDirection, |
number | draftAngle, | ||
number | minClosedLine, | ||
number | minUnclosedLine, | ||
number | resultType | ||
) |
Compute the silhouette or external contour of a SPoly according to a direction and possibly a draft angle.
viewDirection | (SVector) The view direction. |
draftAngle | (number) The draft angle in radian. If zero, the contour seen is output. |
minClosedLine | (number) Delete closed lines whose number of segment is less than this value. |
minUnclosedLine | (number) Delete unclosed lines whose number of segment is less than this value. |
resultType | (number) Choose the result type.
|
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) A table of SMultiline with the silhouette, external contour of the SPoly. |
Object SPoly::GetSurface | ( | ) |
Retrieve the SPoly's surface.
Object SPoly::GetTriangleSize | ( | ) |
Retrieve the size of the smallest and biggest triangle of the current SPoly. The size of a triangle is the size of its longest edge.
ret.ErrorCode | (number) The error code
|
ret.Minimum | (number) The minimum triangle size. |
ret.Maximum | (number) The maximum triangle size. |
number SPoly::GetTrianglesNumber | ( | ) |
Get the number of triangles of the SPoly.
Object SPoly::GetVolume | ( | boolean | isOnlyIfClosed = true | ) |
Retrieve the SPoly's volume.
isOnlyIfClosed | (boolean) Should we stop volume calculation if the surface is not closed? Caution: if false, an approximate volume is returned, which may be totally wrong in the case of 'big' holes |
ret.Volume | (number) The SPoly's volume:
|
ret.Point | (SPoint) The volume's centroid (center of mass or barycenter). We suppose that we have a uniform mass distribution throughout the volume. |
Compute the intersection with an infinite line.
Object SPoly::Intersect | ( | SPoly | poly, |
number | option | ||
) |
Make an intersection between two objects (the current object and a given parameter).
poly | (SPoly) The second SPoly. |
option | (number) Do we include tangent contacts?
|
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) A table with all intersection SMultilines. |
|
static |
Create a meshed surface from two contours or mesh holes, which optionally preserves tangency continuity.
multiLines | (Array<SMultiline>) The two SMultilines defining the 2 contours to join. |
polyhedrons | (Array<SPoly>) The two SPoly which can be used to preserve tangency The length of this table can be 0 if no tangency with a SPoly must be set. The length of this table can be 1 if only the first SMultiline should preserve tangency with this SPoly. The length of this table can be 2 if both SMultiline should preserve tangency |
tangency1 | (number) Tangency option for the first multiline - NOT USED IF THE POLYHEDRON IS DEFINED (length of polyhedrons>=1)
|
tangency2 | (number) Tangency option for the second multiline - NOT USED IF THE POLYHEDRON IS DEFINED (length of polyhedrons==2)
|
tension | (number) The tension of the junction to generate. This parameter must be greater than zero. A good value is between 0.732 and 1. The more this value is high, the more the junction become acute and sharp. |
reorganize | (boolean) Should the mesh be reorganized to follow the local curvature? |
nbPoint | (number) The number of points in the direction perpendicular to contours or holes.
|
|
static |
Compute poly(s) corresponding to the extrusion of profile(s) (SMultiline, linear SFeature, linear SShape object) along a direction, with a given length.
Object SPoly::LoadColorGradient | ( | string | filePath | ) |
Load the color gradient from a file (*.rsi binary file).
filePath | (string) The complete file path to load from |
ret.ErrorCode | (number) The error code
|
ret.Gradient | (SColorGradient) The color gradient associated to the current SPoly |
Object SPoly::LocalizeValues | ( | Array< number > | thresholdList | ) |
Extract the points or the lines at threshold values of an inspected mesh.
thresholdList | (Array<number>) The list of thresholds to extract |
ret.ErrorCode | (number) The error code
|
ret.Results | (Array<Object>) A table of result. Each result is a structure with the following members:
|
|
static |
Sew common edges of a SPoly list, or rebuild topology of existing SPoly.
polyTable | (Array<SPoly>) The SPoly table to fusion. |
option | (FusionOptionEnum) Option for the fusion.
|
accuracyPoint | (number) Accuracy between vertices (distance under which two points are considered identical); Most often 1.E-5 |
accuracyBorders | (number) Accuracy between parallel borders (distance under which two free borders are sewed) |
Object SPoly::MeshSegmentation | ( | number | angleThreshold = 15 , |
number | mergeMaxDistance = 0 , |
||
number | minRegionArea = 0 , |
||
number | classificationMaxDistance = 0 , |
||
SegmentationFeaturesEnum | featuresOption = SPoly.SEGMENTATION_All |
||
) |
Segment a mesh in several regions matching with geometric features (SPlane, SSphere, SCylinder and SCone). The algorithm relies on region growing mechanism and works in two steps:
1 - Create small regions from triangles sharing almost the same normals (according to angleThreshold).
2 - Merge similar regions sharing geometric properties.
angleThreshold | (number) The angle threshold in degree used during the region creation step |
mergeMaxDistance | (number) The maximum distance threshold used during the merging step. If this parameter is non-positive, the value will correspond to 5% of the largest object dimension. |
minRegionArea | (number) The minimum area of regions to keep in the output. If 0, nothing will be removed. |
classificationMaxDistance | (number) The maximum distance authorized to fit feature during classification. If negative, no classification will be performed. |
featuresOption | (SegmentationFeaturesEnum) Option to tell which features must be extracted.
|
ret.ErrorCode | (number) The error code:
|
ret.PlaneTbl | (Array<SPlane>) An array of all the SPlane detected in the Poly |
ret.SphereTbl | (Array<SSphere>) An array of all the SSphere detected in the Poly |
ret.CylinderTbl | (Array<SCylinder>) An array of all the SCylinder detected in the Poly |
ret.ConeTbl | (Array<SCone>) An array of all the SCone detected in the Poly |
ret.PlanePolyTbl | (Array<SPoly>) An array of all the independent SPoly detected as planes in the SPoly (same length as PlaneTbl) |
ret.SpherePolyTbl | (Array<SPoly>) An array of all the independent SPoly detected spheres as in the SPoly (same length as SphereTbl) |
ret.CylinderPolyTbl | (Array<SPoly>) An array of all the independent SPoly detected as cylinders in the SPoly (same length as CylinderTbl) |
ret.ConePolyTbl | (Array<SPoly>) An array of all the independent SPoly detected as cones in the SPoly (same length as ConeTbl) |
ret.UndefinedPolyTbl | (Array<SPoly>) An array of all the independent SPoly that are not detected as an independent geometrical shape |
|
static |
Object SPoly::Offset | ( | boolean | isDirect, |
number | distCoef, | ||
OffsetEnum | option = SPoly.NORMAL_OFFSET |
||
) |
Compute and return a new parallel SPoly.
isDirect | (boolean) Should we offset in the direction of the normal? |
distCoef | (number) The distance or coefficient to apply |
option | (OffsetEnum) How to manage auto-intersections? CAUTION: This option is designed to treat continuous shapes (C1 surfaces). The treatment of surfaces with many sharp edges will not work correctly.
|
|
static |
|
static |
Compute the SPoly corresponding to the extrusion of a given profile along a given path.
profile | (SComp) The profile to extrude |
path | (SComp) The extrusion path |
makePerpendicular | (boolean) true if the profile to extrude has to be perpendicular to the first vector of the path |
turnWthCurve | (boolean) true if the shape has to be oriented according to the curve all along the path |
usePathToLeanOn | (boolean) true if a 2nd path -pathToLeanOn- has to be used to determine the profile orientation |
startAtProfilePosition | (boolean) true if the extrusion has to begin at profile and not at path position |
closeExtremities | (boolean) true if extremities of the extruded SPoly have to be closed |
pathToLeanOn | (SComp) The path to lean on, used only if iUsePathToLeanOn is true |
|
static |
Compute the SPoly corresponding to the extrusion of a given profile along a given path.
profile | (SComp) The profile to extrude |
path | (SComp) The extrusion path |
turnWthPath | (boolean) true if the shape has to be oriented according to the curve all along the path |
profileBasePoint | (SPoint) Point on the profile that will follow the path |
leanPath | (SComp) The path to lean on |
profileLeanPoint | (SPoint) Point of the profile that will be attracted by the lean path |
closeExtremities | (boolean) true if the extremities of the extruded SPoly have to be closed |
Object SPoly::Proj3D | ( | SMultiline | multilineToProject, |
boolean | addIntermediatePt = true |
||
) |
Compute the 3D projection of a SMultiline on a SPoly.
multilineToProject | (SMultiline) The SMultiline to project. |
addIntermediatePt | (boolean) Should we add intermediate points? If true, intermediate points are added every time the line crosses a triangle edge. |
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) Several disconnected pieces can be found during the projection of a SMultiline on a SPoly. It is the reason why the result(s) is returned inside a table. |
Object SPoly::Proj3D | ( | SPoint | point | ) |
Compute the 3D projection of a SPoint on a SPoly.
This function always returns the nearest point.
point | (SPoint) The point to project. |
Object SPoly::ProjDir | ( | SMultiline | multilineToProject, |
SVector | direction, | ||
boolean | addIntermediatePt = true , |
||
boolean | isSignedProjection = false |
||
) |
Compute the projection of a SMultiline on a SPoly with a direction.
multilineToProject | (SMultiline) The multiline to project. |
direction | (SVector) The projection direction |
addIntermediatePt | (boolean) Should we add intermediate points? If true, intermediate points are added every time the line crosses a triangle edge. |
isSignedProjection | (boolean) Should we search only in front of each point of current SMultiline? If false, research is made in both directions. |
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) Several disconnected pieces can be found during the projection of a SMultiline on a SPoly. It is the reason why the result(s) is returned inside a table. |
Compute the projection of a SPoint on a SPoly with a direction.
The point to project is considered as the origin of the direction.
Object SPoly::Reduce | ( | number | targetNbVertex, |
number | minAngle | ||
) |
Reduce a mesh according to the angle between facets to minimize the visual degradation.
targetNbVertex | (number) The number of vertices to keep inside the SPoly. |
minAngle | (number) The angle of the thinest triangle authorized to be created. This angle is in degrees. |
ret.ErrorCode | (number) The error code
|
ret.NbVert | (number) The number of suppressed vertices. |
Object SPoly::ReduceDeviation | ( | number | deviationError, |
DeviationOptionEnum | criteria, | ||
boolean | isSharpEdgeKept = false , |
||
number | deviationOnSharpEdges = 0 , |
||
number | sharpEdgeAngleValue = 0 , |
||
number | maxEdgeLength = 0 , |
||
number | deviationOnBorders = 0 |
||
) |
Reduce the SPoly by deleting some vertices and triangles according to a deviation error.
deviationError | (number) The maximum deviation error. All vertices of the SPoly before the reduction must have a distance lower than this value with the mesh after reduction. |
criteria | (DeviationOptionEnum) The Reduction options
|
isSharpEdgeKept | (boolean) If false there is no restriction on sharp edges. Else if true deviationOnSharpEdges and sharpEdgeAngleValue must be defined |
deviationOnSharpEdges | (number) If isSharpEdgeKept = true, define a deviation value authorized on sharp edges. All vertices on sharp edge of the mesh before the reduction must have a distance lower than this value with the mesh after reduction. If 0, it means that moving/removing points on sharp edge is NOT allowed |
sharpEdgeAngleValue | (number) if isSharpEdgeKept = true, define an angle in degrees between two neighbor triangles to consider that we are on a sharp edge. |
maxEdgeLength | (number) The maximum length of edges. If 0, there is no control on the length of edges |
deviationOnBorders | (number) If ON_BORDERS option is used, define a deviation value authorized on borders. If 0, use the deviation error. |
ret.ErrorCode | (number) The error code
|
Object SPoly::RemeshRefineDev | ( | number | deviation, |
number | sizeMin, | ||
number | maxiTriNumber, | ||
BordersEnum | borderOption, | ||
number | distanceWrongPoints, | ||
number | reorganize, | ||
SCloud | cloud = null , |
||
number | maxCosAngle = -1 |
||
) |
Refine an existing SPoly with deviation error and optionally better fitting on a SCloud.
deviation | (number) The tolerance to respect (deviation error) |
sizeMin | (number) The minimum size of triangles. It is not authorized to create new triangles with a size below this value. |
maxiTriNumber | (number) The maximum number of triangle in the SPoly to return. Note that the input SPoly is not reduced if its number of triangles is already bigger when calling this function. |
borderOption | (BordersEnum) What should be done with free borders?
|
distanceWrongPoints | (number) If a point of the cloud has a distance to the SPoly over this value, it is considered as wrong (aberrant) and the point is rejected. If this value is zero, taking a default value, which is the average triangle size of the current SPoly. |
reorganize | (number) The option bit mask.
|
cloud | (SCloud) The cloud of points, which should be fitted on the new mesh or 0 if none |
maxCosAngle | (number) The max cosine value for the angle between the triangle and the scanning direction. If 0 <= 'maxCosAngle' < 1 AND if 'cloud' has scanning direction information, then the triangles are attracted only by points whose scanning direction makes an angle with triangle's normal lower than this value. This parameter is useful when you try to refine a very thin piece. In such case, you don't want the triangles to be attracted by the other side of the piece. If maxCosAngle is set to -1 no selection is made and thus the scanning directions are effectively ignored. A good value to avoid meshing the other side is 0.1 (~85 degrees). |
ret.ErrorCode | (number) The error code
|
ret.Poly | (SPoly) The resulting refined mesh |
Object SPoly::RemeshSharpEdge | ( | Array< SMultiline > | lines, |
SPoint | referencePoint | ||
) |
Modify locally the existing mesh to recreate sharp edge(s)
lines | (Array<SMultiline>) The table of SMultiline representing the sharp edges(s) to recreate. |
referencePoint | (SPoint) The reference point which indicates the part of the SPoly, whose distance is lower than this value, is authorized to move. |
ret.ErrorCode | (number) The error code
|
ret.Poly | (SPoly) The resulting mesh. |
Object SPoly::RemoveSpikes | ( | number | loopNumber = 1 , |
number | propag = -1 , |
||
number | intensity = 1 , |
||
boolean | isRecomputeBorder = true |
||
) |
Suppress or correct absurd points (i.e. spikes) of the current SPoly.
loopNumber | (number) Number of loops (iteration of the treatment) |
propag | (number) Neighbor level propagation of the treatment. -1 or negative value mean no limit. This functionality allows to detect a point that becomes spike after having suppressed his neighbor. |
intensity | (number) The suppression criterion.
|
isRecomputeBorder | (boolean) Allow to also modify free borders |
ret.ErrorCode | (number) The error code
|
ret.NbVert | (number) The number of suppressed vertices. |
Object SPoly::RemoveTrianglesOnHoles | ( | SCloud | cloud, |
number | holeSize, | ||
number | maxDistToCloud = -1 , |
||
number | maxAngle = -1 |
||
) |
Remove triangles which are considered to be over a hole of a certain diameter regarding 'cloud'.
cloud | (SCloud) The cloud with the corresponding points |
holeSize | (number) The minimal size of a hole (diameter) |
maxDistToCloud | (number) If positive, keep triangles if at least one point of the cloud can be projected inside the triangle. Point to project must be closer than this distance. |
maxAngle | (number) If positive, the max angle value (in degree) between the triangle and the scanning direction. For each triangle it looks only for points with compatible scanning direction. This parameter is useful when you try to refine a very thin piece. In such case, you don't want the triangles to be attracted by the other side of the piece. A good value to avoid meshing the other side is 85 degree. |
ret.ErrorCode | (number) The error code
|
Object SPoly::Save | ( | string | filePath, |
boolean | isTextExport = false , |
||
SMatrix | coordinateSystemMatrix = SMatrix() |
||
) |
Save the mesh into a file.
filePath | (string) The complete file path to save into |
isTextExport | (boolean) Should the mesh be exported as text or binary data?
|
coordinateSystemMatrix | (SMatrix) the matrix to define a UCS used for the export (or identity to use the WCS) |
ret.ErrorCode | (number) The error code
|
Object SPoly::SaveColorGradient | ( | string | filePath | ) |
Save the color gradient into a file (*.rsi binary file).
filePath | (string) The complete file path to save into |
ret.ErrorCode | (number) The error code
|
|
static |
Save the SPoly(s) into a FBX file.
filePath | (string) The complete file path to save into |
meshesToExport | (Array<SPoly>) The list of SPoly(s) to export |
isExportTexture | (boolean) Should the texture be exported? |
exportVertexColor | (EExportVertexColor) The color information to export
|
coordinateSystemMatrix | (SMatrix) The matrix to define a UCS used for the export (or identity to use the WCS) |
0 | No error |
1 | An error occurred |
2 | Some of the exported meshes don't have the chosen texture or color information. |
|
static |
Compute a SPoly from a scanned data by specifying meshing parameters.
cloud | (SCloud) The SCloud to compute. |
boxSize | (number) The size of boxes used to mesh the cloud. |
averagePointDistance | (number) The average distance between points. |
minTriangleSize | (number) The minimum size of the triangles in the SPoly. |
texturePixelSize | (number) The pixel resolution to create a textured SPoly. (Use 0 to not texture) |
ignoreScanDir | (boolean) If true, ignore the scanning directions for computation. |
|
static |
Compute a SPoly from a scanned data by specifying the scanner type.
cloud | (SCloud) The SCloud to compute. |
scannerType | (ScannerType) Choose the type of scanner used for the scan.
|
textureFromCloud | (boolean) If true, create a textured SPoly from cloud color. |
ignoreScanDir | (boolean) If true, ignore the scanning directions for computation. |
|
static |
Compute a SPoly from a scanned data by specifying meshing parameters.
cloud | (SCwCloud) The SCloud to compute. |
boxSize | (number) The size of boxes used to mesh the cloud. |
averagePointDistance | (number) The average distance between points. |
minTriangleSize | (number) The minimum size of the triangles in the SPoly. |
texturePixelSize | (number) The pixel resolution to create a textured SPoly. (Use 0 to not texture) |
ignoreScanDir | (boolean) If true, ignore the scanning directions for computation. |
|
static |
Compute a SPoly from a scanned data by specifying the scanner type.
cloud | (SCwCloud) The SCwCloud to compute. |
scannerType | (ScannerType) Choose the type of scanner used for the scan.
|
textureFromCloud | (boolean) If true, create a textured SPoly from cloud color. |
ignoreScanDir | (boolean) If true, ignore the scanning directions for computation. |
Object SPoly::SectionCylindric | ( | SPoint | firstPointOnAxis, |
SPoint | secondPointOnAxis, | ||
SPoint | pointOnTheFirstCylinder, | ||
number | numberOfCylinders, | ||
number | distancebetweenCylinders | ||
) |
Compute the intersection of a SPoly with parallel cylinders.
firstPointOnAxis | (SPoint) The first point determining axis |
secondPointOnAxis | (SPoint) The second point determining axis |
pointOnTheFirstCylinder | (SPoint) The point on the first cylinder |
numberOfCylinders | (number) If > 0 the sections are done only in the direction of the vector. If < 0, an infinity of parallel planes is assumed. |
distancebetweenCylinders | (number) The distance between cylinders. |
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) An Array of SMultiline, cylindrical sections of the SPolyIf no sections are available returns an empty Array |
Object SPoly::SectionOnMulti | ( | SMultiline | multiLine, |
Array< number > | listDist, | ||
number | maxDist, | ||
number | optBitMask = 0 |
||
) |
Compute the sections of a SPoly (for example a tube or a tunnel) along a SMultiline (normal to the SMultiline). We take points on the neutral axis which are regularly distributed according to a curvilinear distance.
multiLine | (SMultiline) The reference SMultiline. The sections will be computed along this SMultiline with perpendicular planes. |
listDist | (Array<number>) The list of curvilinear distances. In this case, we will compute as many sections as ListDist.length. ListDist contains the list of the offsets from the first point. |
maxDist | (number) The max distance between the sections and the SMultiline. Zero means no limit. The section parts, which are too far away from the MultiLine are deleted. |
optBitMask | (number) Bit mask option
|
ret.ErrorCode | (number) The error code:
|
ret.SetMultiTbl | (Array<SSetMultiline>) The sections computed. A SetMultiline table. |
Object SPoly::SectionOnMultiReg | ( | SMultiline | multiLine, |
number | dist, | ||
number | maxDist, | ||
number | optBitMask = 0 |
||
) |
Compute the sections of a SPoly (for example a tube or a tunnel) along a SMultiline (normal to the SMultiline). We take a list of curvilinear distances.
multiLine | (SMultiline) The reference SMultiline. The sections will be computed along this SMultiline with perpendicular planes. |
dist | (number) the curvilinear and regular distance between two sections. |
maxDist | (number) The max distance between the sections and the SMultiline. Zero means no limit. The section parts, which are too far away from the SMultiline are deleted. |
optBitMask | (number) Bit mask option
|
ret.ErrorCode | (number) The error code:
|
ret.SetMultiTbl | (Array<SSetMultiline>) The sections computed. A SetMultiline table. |
Object SPoly::SectionPlane | ( | SVector | planeNormal, |
SPoint | ptFirstPlane, | ||
number | nbPlanes, | ||
number | distance | ||
) |
Compute the intersection between a SPoly and a parallel plane.
planeNormal | (SVector) The normal vector of the plane |
ptFirstPlane | (SPoint) A point on the first plane |
nbPlanes | (number) The number of parallel planes
|
distance | (number) The distance between planes |
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) An Array of SMultiline, planar sections of the SPoly. If no sections are available returns an empty Array |
Object SPoly::SectionRadial | ( | SPoint | firstPointOnAxis, |
SPoint | secondPointOnAxis, | ||
SPoint | ptFirstPlane, | ||
number | nbSections, | ||
number | maxAngleInRadian | ||
) |
Compute the intersection of a SPoly by radial planes.
firstPointOnAxis | (SPoint) The first point on the axis |
secondPointOnAxis | (SPoint) The second point on the axis |
ptFirstPlane | (SPoint) A point on the first plane or null if indifferent |
nbSections | (number) The number of sections within the maxAngleInRadian. |
maxAngleInRadian | (number) The max angle in radian (2*PI means complete circle). |
ret.ErrorCode | (number) The error code
|
ret.MultiTbl | (Array<SMultiline>) An Array of SMultiline, radial sections of the SPoly. If no sections are available returns an empty Array |
Object SPoly::SeparateTriangleBox | ( | SPoint | lowerPoint, |
SPoint | upperPoint, | ||
SeparateTriBoxEnum | selType, | ||
SeparateTriBoxSelectEnum | whichPartToKeep | ||
) |
Separate triangles of a SPoly according to a box. Depending of whichPartToKeep, the current SPoly is updated and Array.Poly can be fill also (case of SEPARATETRIBOX_KEEP_BOTH).
lowerPoint | (SPoint) The lower point of the box |
upperPoint | (SPoint) The upper point of the box |
selType | (SeparateTriBoxEnum) The option for triangle selection
|
whichPartToKeep | (SeparateTriBoxSelectEnum) The option to know which part has to be kept.
|
ret.ErrorCode | (number) The error code
|
ret.Poly | (SPoly) The mesh or compound mesh containing the triangles removed by the operation (using SEPARATETRIBOX_KEEP_BOTH). |
Object SPoly::SeparateTriangleInPrism | ( | SMultiline | profil, |
number | distance, | ||
SeparateTriBoxEnum | selType, | ||
SeparateTriBoxSelectEnum | whichPartToKeep | ||
) |
Separate triangles of a SPoly according to a prism. Depending of iWhichPartToKeep, the current SPoly is updated and Array.Poly can be fill also (case of SEPARATETRIBOX_KEEP_BOTH). The prism is created by a given planar profile and is extruded on both sides using given distance/2.
profil | (SMultiline) The base SMultiline of the prism (median plane) |
distance | (number) The distance between the two main faces of the prism |
selType | (SeparateTriBoxEnum) The option for triangle selection
|
whichPartToKeep | (SeparateTriBoxSelectEnum) The option to know which part has to be kept.
|
ret.ErrorCode | (number) The error code
|
ret.Poly | (SPoly) The mesh or compound mesh containing the triangles removed by the operation (case of SEPARATETRIBOX_KEEP_BOTH). |
ret.TopContour | (SMultiline) The SMultiline representing the top contour of the prism computed from given profil. |
ret.BottomContour | (SMultiline) The SMultiline representing the bottom contour of the prism computed from given profil. |
ret.ConvexHull | (SMultiline) The SMultiline representing the convex hull contour of the prism computed from given profil for debug purpose. |
Object SPoly::SeparateTriangleSize | ( | number | smallestSize, |
number | biggestSize | ||
) |
Separate a SPoly into parts according to the triangle size.
smallestSize | (number) The minimum size of triangle |
biggestSize | (number) The maximum size of triangle |
ret.ErrorCode | (number) The error code
|
ret.PolySmallTriangle | (SPoly) The SPoly or compound SPoly with the small triangles. |
ret.Poly | (SPoly) The SPoly or compound SPoly without small and big triangles. |
ret.PolyBigTriangle | (SPoly) The SPoly or compound SPoly with the big triangles. |
Object SPoly::SeparateTriangleWithActivatedClippingPlanes | ( | Array< SClippingPlane > | clippingPlanes, |
SeparateTriBoxEnum | selType | ||
) |
Separate triangles of a mesh according to clipping planes. Depending of iWhichPartToKeep, the current SPoly is updated and Array.Poly can be fill also (case of SEPARATETRIBOX_KEEP_BOTH).
clippingPlanes | (Array<SClippingPlane>) The table of SClippingPlane to use. |
selType | (SeparateTriBoxEnum) Option for the selection
|
ret.ErrorCode | (number) The error code
|
ret.Poly | (SPoly) The result mesh with all selected triangles |
Object SPoly::SetBorders | ( | Array< SMultiline > | multiTbl, |
number | remeshDistance | ||
) |
Create a new SPoly by updating the input one in order to make it fit the input border.
multiTbl | (Array<SMultiline>) The input table of SMultiline borders |
remeshDistance | (number) The distance from the borders used for the remeshing |
SPoly::SetPolyRepresentation | ( | PolyRepresentationTypeEnum | representation | ) |
Set the representation of the SPoly.
representation | (PolyRepresentationTypeEnum) The representation to set.
|
Object SPoly::Smooth | ( | number | loopNumber, |
SmoothEnum | option, | ||
number | maxiDeviation, | ||
boolean | isReorganise, | ||
number | minAngleReorg, | ||
number | refineDistProj = -1 , |
||
number | refineVrtxAngle = -1 , |
||
number | angleSharpEdge = -1 , |
||
number | nbTriMax = -1 |
||
) |
Smooth the surface of the current SPoly.
loopNumber | (number) The number of loop of the smoothing calculation. This parameter will determine the smoothing intensity. If zero, the vertices will not move at all. |
option | (SmoothEnum) The option for smoothing
|
maxiDeviation | (number) The maximum distance authorized to determine the new position of the vertices. If this value is <0, no limitation is done. The interpretation of this parameter should be done with the smoothing option. |
isReorganise | (boolean) If true the function Reorganise is called at each loop. |
minAngleReorg | (number) The Angle (in degree) of the thinest triangle authorized to be created if a reorganization is ordered between all the smoothing loops. A good value is 10 degrees. |
refineDistProj | (number) Refinement parameters or 0 if no refinement is required. If a refinement is asked, the function will consider each triangle of the input mesh as a complex piece of surface. Some new vertices are added in the mesh lying on this complex surface so that the triangles are becoming smaller and smaller and also smoother and smoother. If >0, new vertices are added when the deviation from the complex surface to the plane of the triangle is over this value. |
refineVrtxAngle | (number) If >0, new vertices are added when the angle between 2 neighbour vertices is over this value (in degrees) |
angleSharpEdge | (number) If >0, over this value (in degrees) an angle between triangles is considered as a sharp edge without relevant complex surface |
nbTriMax | (number) if not -1, define here max number of triangles of the mesh (triangles are added when refine is made). If only smoothing, no points are added |
ret.ErrorCode | (number) The error code
|
Object SPoly::SmoothBorders | ( | Array< SPoint > | pointTable, |
number | maxEdgeLength = 0 |
||
) |
3D smoothing of borders. The function creates triangles on the edges of the holes to create smooth borders. The borders to be treated are selected with a point on the borders.
pointTable | (Array<SPoint>) A table of points to identify each border to process |
maxEdgeLength | (number) The maximum length of the edges to generate
|
ret.ErrorCode | (number) The error code
|
|
static |
Make a spherical 3D mesh from SCloud(s)
cloudOfPoints | (Array<SCloud>) The table of clouds to mesh |
scanPos | (SPoint) The scanning position. If null, find scan positions in cloud informations (if none, retrieve the centroid of the global cloud as scanning position) |
regularSampling | (number) First filter to make a noise reduction taking in the cloud only points evenly spaced
|
deviationErr | (number) Second filter applied after the first filter. Points are kept in the mesh only if they are needed to have distance with the cloud lower than a certain value. Note however that this distance criterion is statistic and does not means that all the points of the cloud will have a distance with the resulting mesh lower than this value. |
maxiNbTriangle | (number) The maximum number of triangles in the resulting mesh |
alphaShapeThreshold | (number) Parameter for the algorithm of contour detection to delete the triangles that are not part of the surface Recommended value is -3.
|
maxSizeThreshold | (number) Always delete triangles having a size higher than this value. If <=0, this filter will be disabled. |
minSizeThreshold | (number) Never delete triangles having a size smaller than this value. If <=0, this filter will be disabled. |
deleteSmall | (number) During the cleaning process to retrieve holes and contours, we may obtain several disconnected pieces. Each piece with a number of triangles lower than this value is deleted. Note that you can retrieve the number of pieces with the function SPoly.GetNbPieces() and you can also retrieve each individual piece with the function SPoly.Explode() |
Object SPoly::StitchOverlap | ( | SPoly | meshToStitch, |
number | tolDist, | ||
StitchOverlapEnum | options | ||
) |
Stitch a SPoly (meshToStitch) with the current SPoly.
meshToStitch | (SPoly) The SPoly to stitch |
tolDist | (number) The tolerance distance. The zones to merge must overlap with a distance lower than this value. |
options | (StitchOverlapEnum) A combination of SPoly.STITCHOVERLAP_... flags to use
|
ret.ErrorCode | (number) The error code
|
Object SPoly::SubdivideTriangles | ( | number | maxEdgeLength, |
boolean | ignoreFreeEdges = false , |
||
number | limitCos = 0 , |
||
boolean | preserveGeometry = false |
||
) |
Subdivide triangles when at least one of its edges is longer than the maximum allowed edge length.
maxEdgeLength | (number) The maximum allowed edge length. |
ignoreFreeEdges | (boolean) If true does not split free nor selection boundary edges. By default these edges can be split. |
limitCos | (number) The maximum cosine value allowed between each source face normal and new created ones. |
preserveGeometry | (boolean) If true, forces the resulting mesh to fit exactly to the original surface (slower). |
Object SPoly::Tolerance3DMesh | ( | SCloud | cloud, |
number | deviation, | ||
number | distanceWrongPoints, | ||
number | sizeTriMax, | ||
boolean | isReorganize, | ||
number | extension, | ||
boolean | isNoiseReduct | ||
) |
Upgrade the current SPoly by using its topology.
cloud | (SCloud) The cloud of points to mesh |
deviation | (number) The tolerance to respect (deviation error) |
distanceWrongPoints | (number) If a point of the cloud has a distance to the input SPoly over this value, it is considered as wrong (aberrant) and the point is rejected. |
sizeTriMax | (number) The maximum triangle size for triangle created on free contours, if an extension of the existing SPoly is requested. |
isReorganize | (boolean) If true, try to reorganise locally sharp edges or small radii. |
extension | (number) What must be done on free borders. If not 0, the borders can be smoothed and the small holes can be filled. |
isNoiseReduct | (boolean) Should we keep only best points to make noise reduction?
|
ret.ErrorCode | (number) The error code
|
string SPoly::toString | ( | ) |
Get the type of the variable.
string SPoly::ValuesToString | ( | ) |
Get a debug string representation of the poly.
Compute the volume of the SPoly above and below the given elevation.
elevations | (Array<number>) The list of elevations to use |
projDir | (SVector) The normal direction of the planes. |
ret.ErrorCode | (number) The error code
|
ret.ValueTbl | (string) A table of results. Each result is a structure with the following members:
|
Object SPoly::WriteOnMesh | ( | string | textToWrite, |
SVector | textNormal, | ||
SVector | textHorizontalNormal, | ||
SPoint | textPosition, | ||
number | textDepth, | ||
number | planeDepth, | ||
number | scale, | ||
string | font = "Arial" , |
||
boolean | isBold = false , |
||
boolean | isItalic = false , |
||
number | writingStyle = 1 |
||
) |
Write a text on a mesh. The mesh will be engraved.
textToWrite | (string) The text to write |
textNormal | (SVector) The normal direction of the text |
textHorizontalNormal | (SVector) The direction of the writing |
textPosition | (SPoint) The top left corner of the displayed text |
textDepth | (number) The depth of the engraved text |
planeDepth | (number) If>0, Choose to write your text on a plane added to the mesh. By default the text is writing on the mesh directly |
scale | (number) The scale of the text : choose between 0 and 1 |
font | (string) The font of the text. "Arial" by default |
isBold | (boolean) Should the text be in bold? |
isItalic | (boolean) Should the text be in italic? |
writingStyle | (number) The engraving mode
|