Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2022.
 
Loading...
Searching...
No Matches
SPoly.h
1
2
3
5
6#pragma once
7
8#include "RshPluginScript/RshPluginScriptDefines.h"
9#include "RshGeometry/Texture/RshTextureMap.h"
10#include "RshPluginScript/SClass/SComp.h"
11
12#ifndef FCT_DOC
13namespace rsh::ScriptBinding
14{
15#endif // !FCT_DOC
16
38class SPoly : public SComp
39{
40 //======================================================================================================================
41 // INTERNAL FUNCTION
42 //======================================================================================================================
43
44 //======================================================================================================================
45 // DOCUMENTED FUNCTION
46 //======================================================================================================================
47public:
52 {
53 // representations which are always available
54 POLY_SMOOTH, // flat shading and compatible with real time edition
55 POLY_FLAT, // segments and vertices are displayed
56 POLY_WIRE, // wireframe
57 POLY_SMOOTH_WIRE, // smooth shading et wireframe together
58 POLY_FLAT_WIRE, // flat shading and wireframe together
59 POLY_SMOOTH_REALTIME, // smooth shading and compatible with real time edition
60 POLY_TEXTURE, // Textured points / Vertex
61 POLY_COLORED, // Colored points / Vertex
62 POLY_INSPECTION, // Calculate a color based on a value on each vertex.
63 POLY_FLAT_TEXTURE_COLOR, // representation with one color per texture
65 };
66
67
69 {
70 // NORMAL_SMOOTH// The normal smoothing
71 // , DEV_CTRL_SMOOTH// The deviation control smoothing
72 POLY_SMOOTH_KEEP_DETAILS, // Try to keep details during smoothing.
73 POLY_SMOOTH_LIMIT_DIST_BY_PROJ, // We limit the distance of the new vertex location against
74 // the projection on the original surface. Otherwise we limit distance against the original vertex location.
75 POLY_SMOOTH_COMPLEX_SURF, // We consider original mesh triangles as complex surfaces to compute the distance
76 // distance of the new vertex location. Otherwise we consider mesh triangles as flat
77 POLY_SMOOTH_SMOOTH_BORDERS, // If free borders can move
78 };
79
81 {
82 NORMAL_OFFSET, // The basic offset
83 NO_AUTO_INTERSECTION// Auto-intersection are removed in the zones where
84 // the offset value is greater than the local radius
85 };
86
88 {
89 NO_CHANGE, // Don't change free edges (borders)
90 REFINE, // Refine free edges
91 EXTEND_REFINE// Extend (if some cloud points are outside free borders) and refine free edges.
92 };
93
95 {
96 KEEP_EQUI, // Re-mesh locally to preserve equilateral triangles if it is possible.
97 BEST_POS, // Allows to move the point to another position in order to keep the mesh aspect (create new vertices).
98 ON_BORDERS// Allows to also reduce the free borders (will reduce free borders size and can result in filling some small holes).
99 };
100
104 {
105 PERSPECTIVE, // Standard pinhole camera model
106 EQUIRECTANGULAR, // Spherical camera, with equirectangular image projection
107 REPETITIVE, // To map a repetitive texture
108 FISH_EYE, // Fish Eye image projection
109 };
110
114 {
115 SPHERE_FORCE_NOTHING, // Nothing is forced
116 SPHERE_FORCE_RADIUS, // Radius is forced
117 SPHERE_FORCE_CENTER// Center is forced
118 };
119
123 {
124 CYL_FORCE_NOTHING, // Nothing is forced
125 CYL_FORCE_RADIUS, // Radius is forced
126 CYL_INIT_RADIUS, // Radius is initialized (near from its good value)
127 CYL_FORCE_CENTER, // Center is forced (an axis passing through Center should be found)
128 CYL_INIT_CENTER, // Center is initialized (near from its good position)
129 CYL_FORCE_DIRECTION, // Direction is forced (DirectionVector exactly)
130 CYL_INIT_DIRECTION// Direction is approximately (DirectionVector nearly)
131 };
132
134 {
135 STITCHOVERLAP_MAKE_SEWING_ZONE_INVISIBLE, // Modify the sewing zone so that it should not be visible.
136 STITCHOVERLAP_REORGANIZE_SEWING_ZONE, // Reorganize the sewing zone.
137 STITCHOVERLAP_MODIFY_OVERLAP_IN_MIDDLE_ZONE, // Modify the output overlapping surface so that it becomes in the middle of the two input surfaces.
138 STITCHOVERLAP_ONLY_CONSISTENT_NORMALES, // Process only overlapping areas having triangle normals oriented in the same way. Do not change triangle orientation during the stitching.
139 };
140
142 {
143 SEPARATETRIBOX_STRICLTY_INSIDE, // Select triangles that are strictly inside the box
144 SEPARATETRIBOX_ONLY_CROSSING, // Select triangles that are only crossing the box
145 SEPARATETRIBOX_CROSSING_AND_INSIDE, // Select triangles that are crossing the box or inside
146 };
147
149 {
150 SEPARATETRIBOX_KEEP_INSIDE_TRI, //Update the current SPoly and keep only triangles inside the box (or only triangles crossing the box).
151 SEPARATETRIBOX_KEEP_OUTSIDE_TRI, //Update the current SPoly and Keep only unselected triangles
152 SEPARATETRIBOX_KEEP_BOTH, // Keep both parts, the current SPoly will be made with unselected triangles, the selected triangles will be put inside Array.Poly
153 };
154
156 {
157 SEGMENTATION_PLANE, // Extract planes in the mesh segmentation.
158 SEGMENTATION_SPHERE, // Extract spheres in the mesh segmentation
159 SEGMENTATION_CONE, // Extract cones in the mesh segmentation
160 SEGMENTATION_CYLINDER, // Extract cylinders in the mesh segmentation
161 SEGMENTATION_All// Extract all available features in the mesh segmentation
162 };
163
164public slots: // these functions (slots) will be available in QtScript
165
166
169 // TESTED
171
182 // TESTED
183 Array GetSurface();
184
198 // TESTED
200 Boolean iIsOnlyIfClosed
203 );
204
207 // TESTED
208 Number GetNbPieces();
209
224 // TESTED
226 Boolean iIsOnlyIfClosed
229 );
230
239 // TESTED
241 SVector iPlaneNormal,
243 SPoint iPtFirstPlane,
245 Number iNbPlanes,
249 Number iDistance
251 );
252
261 // TESTED
263 SPoint iFirstPointOnAxis,
265 SPoint iSecondPointOnAxis,
267 SPoint iPtFirstPlane,
269 Number iNbSections,
271 Number iMaxAngleInRadian
273 );
274
283 // TESTED
285 SPoint iFirstPointOnAxis,
287 SPoint iSecondPointOnAxis,
289 SPoint iPointOnTheFirstCylinder,
291 Number iNumberOfCylinders,
294 Number iDistanceBeetweenCylinders
296 );
297
311 //TESTED
313 SMultiline iMultiLine,
316 Number iDist,
318 Number iMaxDist,
321 Number iOptBitMask
325 );
337 //TESTED
339 SMultiline iMultiLine,
342 Array<Number> iListDist,
346 Number iMaxDist,
349 Number iOptBitMask
353 );
354
363 // TESTED
365 SPoint iPoint,
367 SVector iVect
369 ) ;
370
381 // TESTED
382 Array Proj3D(SPoint iPoint
384 ) ;
385
396 // TESTED
397 Array Proj3D(
398 SMultiline iMultilineToProject,
400 Boolean iHadIntermediatePt
403 ) ;
404
415 // TESTED
416 Array ProjDir(
417 SPoint iPoint,
419 SVector iDirection,
421 Boolean iIsSignedProjection
424 ) ;
425
438 // TESTED
439 Array ProjDir(
440 SMultiline iMultilineToProject,
442 SVector iDirection,
444 Boolean iHadIntermediatePt,
447 Boolean iIsSignedProjection
450 ) ;
451
462 // TESTED
463 Array Explode() ;
464
472 Array ExplodeColor() ;
473
482
493 Number iSmallestSize,
495 Number iBiggestSize
497 ) ;
498
508 SPoint iLowerPoint,
510 SPoint iUpperPoint,
512 SeparateTriBoxEnum iSelType,
514 SeparateTriBoxSelectEnum iWhichPartToKeep
516 );
517
531
533 SMultiline iProfil,
535 Number iDistance,
537 SeparateTriBoxEnum iSelType,
539 SeparateTriBoxSelectEnum iWhichPartToKeep
541 );
542
554 Array<SClippingPlane>
555 iClippingPlanes,
557 SeparateTriBoxEnum iSelType
559 );
560
569
580 // TESTED
581 Array BooleanAdd(SPoly iPoly);
582
591 // TESTED
592 Array BooleanSub(SPoly iPoly);
593
604 // TESTED
605 Array BooleanCommon(SPoly iPoly
607 );
608
619 // TESTED
620 Array BooleanCutIn(SPoly iPoly
622 );
623
634 // TESTED
635 Array BooleanCutOut(SPoly iPoly
637 );
638
654 SPoly iPoly,
656 Boolean iIsCutPoly
658 );
659
675 // TESTED
677 SPoly iPoly,
679 Number iOption
684 );
685
698 // TESTED
699 Array Smooth(
700 Number iLoopNumber,
703 SmoothEnum iOptionMask,
713 Number iMaxiDeviation,
716 Boolean iIsReorganise,
718 Number iMinAngleReorg,
723 Number iRefineDistProj = -1.0,
729 Number iRefineVrtxAngle =
730 -1.0,
732 Number iAngleSharpEdge = -1.0,
735 Number iNbTriMax =
736 -1
739 );
740
750 //TESTED
751 Array Offset(
752 Boolean iIsDirect,
754 Number iDistCoef,
756 OffsetEnum iOptBitMask
764 ) ;
765
785 // TESTED
787 Number iDeviation,
789 Number iSizeMin,
792 Number iMaxiTriNumber,
796 BordersEnum iBorderOption,
804 Number iDistanceWrongPoints,
809 Number iReorganize,
813 SCloud iCloud,
815 Number iMaxCosAngle = -1
823 ) ;
824
832 // TESTED
833 Array Reduce(
834 Number iTargetNbVertex,
836 Number iMinAngle
839 );
840
855 // TESTED
856 Array Compare(
857 SPoly iMeasPoly,
859 Number iDistMax,
861 Number iMappingObject,
864 Boolean iIsIgnoreEdge,
868 SVector iDirection,
871 Number iMaxCosAngle = 0.,
877 Boolean iIsCheckThinParts
881 );
882
906 // TESTED
907 Array Compare(
908 SCloud iMeasCloud,
910 Number iDistMax,
912 Number iMappingObject,
915 Boolean iIsIgnoreEdge,
919 SVector iDirection,
922 Number iMaxCosAngle = -2,
928 Boolean iIsCheckForThinParts
934 );
935
944
953
964 Array GetTextureName(Number iTextureIdx
966 ) ;
967
979
986 // TESTED
988 Number iDeviationError,
991 DeviationOptionEnum iCriteria,
998 Boolean iIsKeepSharpEdge,
1001 Number iDeviationOnSharpEdges,
1006 Number iSharpEdgeAngleValue,
1009 Number iMaxEdgeLength, // [in] /// The maximum length of the new edges. Use to avoid having too big triangle.
1012 Number iDeviationOnBorders
1015 );
1016
1018 Array Contours(Boolean iIsExportSuspiciousTriangles = false);
1019
1038 Array<SPoint> iPointTable,
1040 Number iTension,
1054 Number iWallThickness = -1
1057 );
1058
1070 Array<SMultiline> iContourTable,
1072 Number iTension = 0.732f,
1086 Number iWallThickness = -1,
1089 Boolean iIsForceNonSmoothShape
1092 );
1093
1105 // TESTED
1107 SVector iDirection,
1110 Array<SPoint> iPointTable,
1113 Number iTension
1128 );
1129
1137 Array<SPoint> iPointTable,
1139 Number iMaxEdgeLength
1141 );
1142
1150 Array<SMultiline> iMultiTbl,
1152 Number iRemeshDistance
1154 );
1155
1168 Array<SSetMultiline> iSetMultiTbl,
1175 Number iRemeshDistance,
1177 Number iCleaningDistance
1179 );
1180
1209 Array Save(
1210 String iFilePath,
1212 Boolean iIsTextExport,
1216 SMatrix iCoordinateSystemMatrix = {}
1219 );
1220
1227 Array GetColorGradient() { return SComp::GetColorGradient(); }
1228
1246 Array LoadColorGradient(String iFilePath
1248 )
1249 {
1250 return SComp::LoadColorGradient(iFilePath);
1251 }
1252
1270 Array SaveColorGradient(String iFilePath
1272 )
1273 {
1274 return SComp::SaveColorGradient(iFilePath);
1275 }
1276
1284 //TESTED
1286 SPoint iSeedPoint,
1288 Number iTolerance
1291 ) ;
1292
1301 Array<SPoint>
1302 iSeedPoint,
1304 Number iTolerance,
1307 SphereEnum iForce,
1311 SPoint Center = {},
1313 Number iRadius
1315 );
1316
1325 Array<SPoint>
1326 iSeedPoint,
1328 Number iTolerance,
1331 CylinderEnum iForce,
1340 SPoint iCenter = {},
1342 SVector iDirectionVector = {},
1344 Number iRadius
1346 );
1347
1356 Number iSmoothingIntensity = 0.0
1358 );
1359
1369 Array GetContours() ;
1370
1374
1382 Number iLoopNumber,
1384 Number iPropag = -1,
1388 Number iIntensity,
1395 Boolean iIsRecalculateBorder
1397 );
1398
1424 SCloud iCloud,
1426 Number iDeviation,
1428 Number iDistanceWrongPoints,
1432 Number iSizeTriMax,
1435 Boolean iIsReorganize,
1437 Number iExtension,
1443 Boolean iIsNoiseReduct
1447 );
1448
1468 SCloud iCloudOfPoints,
1470 Array<SMultiline>
1471 iSetOfMultilines,
1474 Number iTolerance,
1476 Number iZoneType
1483 ) ;
1484
1494 SVector iViewDirection,
1496 Number iDraftAngle,
1498 Number iMinClosedLine,
1500 Number iMinUnclosedLine,
1502 Number iResultType
1507 ) ;
1508
1520 String iFilePathName,
1522 Number iNbRepWidth,
1524 Number iNbRepHeight,
1526 SVector iDirXScreen,
1528 SVector iDirYScreen,
1530 SPoint iImageOrigin
1532 );
1533
1541 Array<SMultiline>
1542 iLines,
1544 SPoint iReferencePoint
1546 );
1547
1565 Array<SCloud> iCloudsTbl,
1568 Number iIgnoreOver,
1573 Number iResetColor,
1579 Number iDefaultRed,
1581 Number iDefaultGreen,
1583 Number iDefaultBlue
1585 );
1586
1591 );
1592
1627 Array LocalizeValues( Array<Number> iThresholdList
1629 );
1630
1637 String iTextToWrite,
1639 SVector iTextNormal,
1641 SVector iTextHorizontalNormal,
1643 SPoint iTextPosition,
1645 Number iTextDepth,
1647 Number iPlaneDepth,
1649 Number iScale,
1651 String iFont = "Arial",
1653 Boolean isBold,
1655 Boolean isItalic,
1657 Number iWritingStyle
1659 );
1660
1668 SVector iDirection
1670 ) ;
1671
1679 SVector iDirection
1681 ) ;
1682
1694 SPoly iSecondPoly,
1696 SVector iProjDir = {}
1698 );
1699
1713 SCloud iCloud,
1715 Number iHoleSize,
1717 Number iMaxDistToCloud = 0.f,
1720 Number iOptions,
1725 Number iMaxCosAngle = -1
1730 );
1731
1741 SCloud iCloud,
1743 Number iHoleSize,
1745 Number iMaxDistToCloud =
1746 -1,
1749 Number iMaxAngle = -1
1754 );
1755
1773 SPoly iMeshToStitch,
1775 Number iTolDist,
1777 StitchOverlapEnum iOptions
1779 );
1780
1793 Array<Number> iElevations,
1795 SVector iProjDir = { 0., 0., 1. }
1797 );
1798
1810 Number iMaxEdgeLength,
1812 Boolean iIgnoreFreeEdges,
1814 Number iLimitCos = 0.,
1816 Boolean iPreserveGeometry
1818 );
1819
1841 Number iAngleThreshold = 15.0,
1843 Number iMergeMaxDistance = 0.,
1846 Number iMinRegionArea = 0.,
1848 Number iClassificationMaxDistance = 0.,
1851 SegmentationFeaturesEnum iFeatures
1859 ) ;
1860
1863 String toString() ;
1864};
1865
1866// @brief
1867// this class allow to wrap static function to SPoly easily
1868// this allow to wrap constructor more easily the constructor will be declared with the function New(...)
1869class SPoly
1870#ifndef FCT_DOC
1871 : public SObjectStatic
1872#endif // FCT_DOC
1873{
1874 //======================================================================================================================
1875 // INTERNAL FUNCTION
1876 //======================================================================================================================
1877
1878 //======================================================================================================================
1879 // DOCUMENTED FUNCTION
1880 //======================================================================================================================
1881public:
1883 {
1886 ALL_CLOSED};
1887
1889 {
1890 SIMPLE, // Simple fusion without any modification
1891 REMESH, // If parallel free contour are found try to re-mesh locally to merge them.
1892 FILL_HOLES, // Try to fill all the holes except the biggest one (free border).
1893 CLOSE// Try to close the polyhedron
1895
1899 {
1900 ROTATE_AUTO, // Function will defined automatically the good rotate point
1901 ROTATE_CENTROID, // Use centroid of the profile
1902 ROTATE_INTERSECTION, // Use intersection of the profile with path
1903 ROTATE_USER_DEFINE // You must defined your rotate point
1905
1906public slots:
1909 // TESTED
1910 static SPoly New();
1911
1914 // TESTED
1915 static SPoly New(SPoly iOther);
1916
1926 static Array ColorAlongDir(
1927 Array<SPoly> iMeshes,
1929 SVector iDirectionVect,
1931 SPoint iOrigin = {}
1933 );
1934
1944 static Array FromClick() { return SComp::GetFromClick<SPoly>(SV_POLY); }
1945
1949 static Array FromName( String iName) { return SComp::GetFromName<SPoly>(iName); }
1950
1954 // TESTED
1955 static Array FromSel();
1956
1960 // TESTED
1961 static Array All(
1962 Number iVisCrit
1967 )
1968 {
1969 return SComp::GetAll<SPoly>(iVisCrit);
1970 }
1971
1987 // TESTED
1988 static Array FromFile(String iFileName
1990 );
1991
2007 static Array ConstraintMesh2D(
2008 SCloud iCloudOfPoints,
2010 Array<SMultiline>
2011 iSetOfMultilines,
2014 SVector iMeshDir,
2017 Number iTolerance,
2019 Number iZoneType
2026 );
2027
2040 // TESTED
2041 static Array Direct3DMesh(
2042 SCloud iCloudToMesh,
2044 Number iDeviationError,
2046 Number iMiniAverageDist,
2056 HoleOptionEnum iOptionHole,
2068 Number iSizeTriHole,
2070 Boolean iIsIgnoreScanDir
2072 );
2073
2089 // TESTED
2090 static Array DirectionMesh(
2091 SCloud iCloudOfPoints,
2093 SVector iMeshingDirection,
2096 Number iTolerance,
2098 Boolean iIsFindCntr
2100 );
2101
2109 static Array SphericalMesh(
2110 Array<SCloud> iCloudOfPoints,
2112 SPoint iScanPos,
2115 Number iRegularSampling,
2122 Number iDeviationErr,
2127 Number iMaxiNbTriangle,
2129 Number iAlphaShapeThreshold,
2138 Number iMaxSizeThreshold,
2140 Number iMinSizeThreshold,
2142 Number iDeleteSmall
2147 );
2148
2157 static Array Extrusion(
2158 SMultiline iProfile,
2160 SMultiline iPath,
2162 Boolean iTurnWithPath,
2164 Boolean iPerpendicularToPath,
2166 SMultiline iSecondPath,
2169 RotateEnum iOption,
2171 // ROTATE_AUTO // Function will defined automatically the good rotate point
2174 // ROTATE_INTERSECTION // Use intersection of the profile with path
2177 SPoint iRotatePt
2179 );
2180
2196 // TESTED
2197 static Array Fusion(
2198 Array<SPoly> iPolyTable,
2200 FusionOptionEnum iOption,
2206 Number iAccuracyPoint = 1.E-5,
2209 Number iAccuracyBorders = 0.001
2212 );
2213
2230 Array<SPoly> iPolyTable,
2232 FusionOptionEnum iOption,
2238 Number iAccuracyPoint = 1.E-5,
2241 Number iAccuracyBorders = 0.001
2244 );
2245
2256 // TESTED
2257 static Array JoinContour(
2258 Array<SMultiline>
2259 iMultiLines,
2261 Array<SPoly>
2262 iPolyhedrons,
2267 Number iTangency1,
2274 Number iTangency2,
2281 Number iTension = 0.732,
2285 Boolean iReorganize,
2287 Number iNbPoint
2291 );
2292
2304 static Array CreateCompound(
2305 Array<SPoly> iTablePoly,
2308 Boolean iOptOrient
2312 );
2313
2325 static Array PipeTubeAlongPath(
2326 Number iRadius,
2327 Boolean iCloseExtremities,
2328 Array<SComp> iComps);
2329
2342 static Array LinearExtrusion(
2343 Number iLength,
2344 SVector iDirection,
2345 Boolean iCloseExtremities,
2346 Array<SComp> iComps);
2347
2350 static String toString();
2351};
2352Q_DECLARE_METATYPE(SPoly::_SPolyDummy);
2353Q_DECLARE_METATYPE(SPoly);
2354
2355#ifndef FCT_DOC
2356} // namespace rsh::ScriptBinding
2357#endif // !FCT_DOC
2358
2359#ifndef FCT_DOC
2360namespace rsh::Script::ScriptConvert
2361{
2362template<>
2363struct TblConvert<SPoly>
2364{
2365 static char GetClassName() { return "SPoly"; }
2366
2367 typedef SPoly ScriptClass;
2368 typedef SPoly DCompClass;
2369
2370 static SPoly GetGCompClass(SPoly _iCompClass)
2371 {
2372 return _iCompClass.GetGPoly();
2373 }
2374
2375 static SPoly ForDCompConstructor(SPoly _iEnt) { return _iEnt; }
2376};
2377#endif
2378}
The SCloud class provides point cloud manipulation. The SCloud creation can be done by calling the st...
Definition: SCloud.h:41
The SComp class is an abstract class. Use derived classes SCircle, SCylinder, SCloud,...
Definition: SComp.h:32
Matrix with 3 lines and 4 columns to make any transformation. This class should be used in order to a...
Definition: SMatrix.h:21
Class to store a multiline, that is: an ordered list of points. The SMultiline creation can be done b...
Definition: SMultiLine.h:24
3D point manipulation class. The SPoint creation can be done by calling the static functions:
Definition: SPoint.h:23
The SPoly class provides triangular mesh(es) manipulation. The SPoly creation can be done by calling ...
Definition: SPoly.h:39
Number GetTrianglesNumber()
Array WriteOnMesh(String iTextToWrite, SVector iTextNormal, SVector iTextHorizontalNormal, SPoint iTextPosition, Number iTextDepth, Number iPlaneDepth, Number iScale, String iFont="Arial", Boolean isBold, Boolean isItalic, Number iWritingStyle)
Write a text on a mesh. The mesh will be engraved.
static SPoly New()
Default constructor to create an empty new SPoly.
Number GetNbPieces()
static Array SphericalMesh(Array< SCloud > iCloudOfPoints, SPoint iScanPos, Number iRegularSampling, Number iDeviationErr, Number iMaxiNbTriangle, Number iAlphaShapeThreshold, Number iMaxSizeThreshold, Number iMinSizeThreshold, Number iDeleteSmall)
Makes a spherical 3D mesh from point cloud(s)
SetPolyRepresentation(PolyRepresentationTypeEnum Representation)
The representation of the component is modified.
static Array Direct3DMesh(SCloud iCloudToMesh, Number iDeviationError, Number iMiniAverageDist, HoleOptionEnum iOptionHole, Number iSizeTriHole, Boolean iIsIgnoreScanDir)
Makes a direct 3D mesh of a point cloud according different strategies (regular, deviation,...
Array ExtractPlane(SPoint iSeedPoint, Number iTolerance)
Extract the planar region on the current cloud starting from seed point(s).
static Array Extrusion(SMultiline iProfile, SMultiline iPath, Boolean iTurnWithPath, Boolean iPerpendicularToPath, SMultiline iSecondPath, RotateEnum iOption, SPoint iRotatePt)
Create a mesh from a path and a profile, the profile is extracted along the path.
Array Proj3D(SMultiline iMultilineToProject, Boolean iHadIntermediatePt)
Calculates the 3D projection of a SMultiline on an SPoly.
Array FillHolesDirection(SVector iDirection, Array< SPoint > iPointTable, Number iTension)
To fill the holes that have at least one point listed in the table of points.
Array SectionCylindric(SPoint iFirstPointOnAxis, SPoint iSecondPointOnAxis, SPoint iPointOnTheFirstCylinder, Number iNumberOfCylinders, Number iDistanceBeetweenCylinders)
Intersection of a Polyhedron by parallel cylinders.
OffsetEnum
Definition: SPoly.h:81
@ NORMAL_OFFSET
Definition: SPoly.h:82
HoleOptionEnum
Definition: SPoly.h:1883
@ INSIDE_CLOSED
Definition: SPoly.h:1885
@ NO_CLOSED
Definition: SPoly.h:1884
Array SeparateTriangleWithActivatedClippingPlanes(Array< SClippingPlane > iClippingPlanes, SeparateTriBoxEnum iSelType)
Separate triangles of a mesh according to clipping planes. Depending of iWhichPartToKeep,...
Array Reduce(Number iTargetNbVertex, Number iMinAngle)
Function to reduce a mesh according to the angle between facets to minimize the visual degradation.
static Array FromName(String iName)
Search all the component with the given name.
Definition: SPoly.h:1949
static Array LinearExtrusion(Number iLength, SVector iDirection, Boolean iCloseExtremities, Array< SComp > iComps)
Compute poly(s) corresponding to the extrusion of profile(s) -polyline, linear feature,...
Array TakeColorFromClouds(Array< SCloud > iCloudsTbl, Number iIgnoreOver, Number iResetColor, Number iDefaultRed, Number iDefaultGreen, Number iDefaultBlue)
Uses the color (or the color of inspection) of point clouds to color the vertices on the current mesh...
static Array FromFile(String iFileName)
Array LoadColorGradient(String iFilePath)
Loads the color gradient from a file (*.rsi binary file).
Definition: SPoly.h:1246
Array ConstraintMesh3D(SCloud iCloudOfPoints, Array< SMultiline > iSetOfMultilines, Number iTolerance, Number iZoneType)
Makes a 3D meshing on a mesh (this), a set of multilines and a point cloud; both are optional but at ...
Array ExtractSphere(Array< SPoint > iSeedPoint, Number iTolerance, SphereEnum iForce, SPoint Center={}, Number iRadius)
Extract the spherical region on the current polyhedron starting from seed point(s).
Clear()
To deallocate memory of the object.
Array Cubature(SPoly iSecondPoly, SVector iProjDir={})
Calculate volumes between 2 surfaces to make cubature of embankments and excavations....
Array SmoothBorders(Array< SPoint > iPointTable, Number iMaxEdgeLength)
3D smoothing of free borders. The function creates triangles on the edges of the holes to create smoo...
Array ImproveBorders(Array< SSetMultiline > iSetMultiTbl, Number iRemeshDistance, Number iCleaningDistance)
Create a new SPoly by updating the input one in order to make it fit the input border.
Array GetTriangleSize()
To retrieve the triangle size of current SPoly.
BordersEnum
Definition: SPoly.h:88
@ REFINE
Definition: SPoly.h:90
@ NO_CHANGE
Definition: SPoly.h:89
Array RemoveSpikes(Number iLoopNumber, Number iPropag=-1, Number iIntensity, Boolean iIsRecalculateBorder)
This function will suppress or correct absurd points (ie spikes) of the current SPoly.
Array FillHoles(Array< SPoint > iPointTable, Number iTension, Number iWallThickness=-1)
3D Hole filling. The function creates triangles on the edges of the holes to fill the concave parts....
Array ExplodeColor()
Explodes a compound mesh into several parts according to the color of the triangles.
Array Proj3D(SPoint iPoint)
Calculates the 3D projection of a point on an SPoly. This function always returns the nearest point.
SmoothEnum
Definition: SPoly.h:69
@ POLY_SMOOTH_SMOOTH_BORDERS
Definition: SPoly.h:77
@ POLY_SMOOTH_LIMIT_DIST_BY_PROJ
Definition: SPoly.h:73
@ POLY_SMOOTH_COMPLEX_SURF
Definition: SPoly.h:75
@ POLY_SMOOTH_KEEP_DETAILS
Definition: SPoly.h:72
Array SeparateTriangleSize(Number iSmallestSize, Number iBiggestSize)
Separate a mesh into parts according to the triangle size.
CylinderEnum
Bit mask to know which parameter(s) are forced and do not need to be computed.
Definition: SPoly.h:123
@ CYL_FORCE_DIRECTION
Definition: SPoly.h:129
@ CYL_INIT_RADIUS
Definition: SPoly.h:126
@ CYL_INIT_CENTER
Definition: SPoly.h:128
@ CYL_FORCE_NOTHING
Definition: SPoly.h:124
@ CYL_FORCE_RADIUS
Definition: SPoly.h:125
@ CYL_FORCE_CENTER
Definition: SPoly.h:127
Array Smooth(Number iLoopNumber, SmoothEnum iOptionMask, Number iMaxiDeviation, Boolean iIsReorganise, Number iMinAngleReorg, Number iRefineDistProj=-1.0, Number iRefineVrtxAngle=-1.0, Number iAngleSharpEdge=-1.0, Number iNbTriMax=-1)
Smooth the surface of the current SPoly.
static Array PipeTubeAlongPath(Number iRadius, Boolean iCloseExtremities, Array< SComp > iComps)
Compute mesh(es) corresponding to the extrusion of a circle with a given radius along a given path.
static Array Fusion(Array< SPoly > iPolyTable, FusionOptionEnum iOption, Number iAccuracyPoint=1.E-5, Number iAccuracyBorders=0.001)
Sew common edges of a SPoly list, or rebuild topology of existing Polyhedron(s).
static String toString()
Get the type of the variable.
Array GetContours()
Extract free contour(s) from the current SPoly. Returns a table of SMultilines containing all the fre...
static Array ConstraintMesh2D(SCloud iCloudOfPoints, Array< SMultiline > iSetOfMultilines, SVector iMeshDir, Number iTolerance, Number iZoneType)
Makes a 2D1/2 meshing on a set of multilines and a point cloud; both are optional but at least one is...
StitchOverlapEnum
Definition: SPoly.h:134
@ STITCHOVERLAP_MAKE_SEWING_ZONE_INVISIBLE
Definition: SPoly.h:135
@ STITCHOVERLAP_REORGANIZE_SEWING_ZONE
Definition: SPoly.h:136
@ STITCHOVERLAP_MODIFY_OVERLAP_IN_MIDDLE_ZONE
Definition: SPoly.h:137
@ STITCHOVERLAP_ONLY_CONSISTENT_NORMALES
Definition: SPoly.h:138
Number GetNumberOfTextureMaps()
Returns the number of dynamic textures (texture maps) applied to the mesh.
Array StitchOverlap(SPoly iMeshToStitch, Number iTolDist, StitchOverlapEnum iOptions)
Stitch a SPoly (meshToStitch) with the current SPoly.
Array GetVolume(Boolean iIsOnlyIfClosed)
To retrieve the polyhedron's volume.
DeviationOptionEnum
Definition: SPoly.h:95
@ BEST_POS
Definition: SPoly.h:97
@ KEEP_EQUI
Definition: SPoly.h:96
Array SetBorders(Array< SMultiline > iMultiTbl, Number iRemeshDistance)
Create a new SPoly by updating the input one in order to make it fit the input border.
Array SubdivideTriangles(Number iMaxEdgeLength, Boolean iIgnoreFreeEdges, Number iLimitCos=0., Boolean iPreserveGeometry)
Subdivide triangles when at least one of its edges is longer than the maximum allowed edge length.
static Array FromClick()
Launches a click interaction to select a SComp in the scene.
Definition: SPoly.h:1944
Array BooleanCutIn(SPoly iPoly)
To cut the current SPoly against the parameter SPoly and keep the part of the current SPoly that is I...
static Array MergeCommonBorders(Array< SPoly > iPolyTable, FusionOptionEnum iOption, Number iAccuracyPoint=1.E-5, Number iAccuracyBorders=0.001)
Sew common edges of a SPoly list, or rebuild topology of existing Polyhedron(s).
Array SectionOnMultiReg(SMultiline iMultiLine, Number iDist, Number iMaxDist, Number iOptBitMask)
Compute the sections of a SPoly (for example a tube or a tunnel) along a SMultiline (normal to the SM...
Array GetSurface()
To retrieve the polyhedron's surface.
ProjectionTypeEnum
Enumeration of all available texturage projection types.
Definition: SPoly.h:104
@ EQUIRECTANGULAR
Definition: SPoly.h:106
@ FISH_EYE
Definition: SPoly.h:108
@ PERSPECTIVE
Definition: SPoly.h:105
@ REPETITIVE
Definition: SPoly.h:107
static Array FromSel()
To get all the selected SComp.
Array SeparateTriangleBox(SPoint iLowerPoint, SPoint iUpperPoint, SeparateTriBoxEnum iSelType, SeparateTriBoxSelectEnum iWhichPartToKeep)
Separate triangles of a mesh according to a box. Depending of iWhichPartToKeep, the current poly is u...
Array Intersect(SPoly iPoly, Number iOption)
To make an intersection between two objects (the current object and a given parameter).
PolyRepresentationTypeEnum
The different representation types for polyhedrons. Use SPoly.SMOOTH.
Definition: SPoly.h:52
@ POLY_WIRE
Definition: SPoly.h:56
@ POLY_TEXTURE
Definition: SPoly.h:60
@ POLY_FLAT
Definition: SPoly.h:55
@ POLY_SMOOTH
Definition: SPoly.h:54
@ POLY_COLORED
Definition: SPoly.h:61
@ POLY_FLAT_TEXTURE_COLOR
Definition: SPoly.h:63
@ POLY_INSPECTION
Definition: SPoly.h:62
@ POLY_TEXTURE_ASYNC
Definition: SPoly.h:64
@ POLY_FLAT_WIRE
Definition: SPoly.h:58
@ POLY_SMOOTH_WIRE
Definition: SPoly.h:57
@ POLY_SMOOTH_REALTIME
Definition: SPoly.h:59
Array SeparateTriangleInPrism(SMultiline iProfil, Number iDistance, SeparateTriBoxEnum iSelType, SeparateTriBoxSelectEnum iWhichPartToKeep)
Separate triangles of a mesh according to a prism. Depending of iWhichPartToKeep, the current poly is...
Array RemoveTrianglesOnHoles(SCloud iCloud, Number iHoleSize, Number iMaxDistToCloud=-1, Number iMaxAngle=-1)
Remove triangles which are considered to be over a hole of a certain diameter regarding iCloud.
Array GetTextureName(Number iTextureIdx)
Returns the original name of a dynamic texture (texture map) applied to the mesh.
Array Save(String iFilePath, Boolean iIsTextExport, SMatrix iCoordinateSystemMatrix={})
Saves the mesh into a file.
Array MeshSegmentation(Number iAngleThreshold=15.0, Number iMergeMaxDistance=0., Number iMinRegionArea=0., Number iClassificationMaxDistance=0., SegmentationFeaturesEnum iFeatures)
Segment a mesh in several regions matching with geometric features (Plane, Sphere,...
String toString()
Get the type of the variable.
Array InterInfLine(SPoint iPoint, SVector iVect)
Calculates the intersection with an infinite line.
Array GetHighestPoint(SVector iDirection)
Get the highest point according to the Direction.
Array Tolerance3DMesh(SCloud iCloud, Number iDeviation, Number iDistanceWrongPoints, Number iSizeTriMax, Boolean iIsReorganize, Number iExtension, Boolean iIsNoiseReduct)
Upgrade the current SPoly by using its topology.
Array ProjDir(SMultiline iMultilineToProject, SVector iDirection, Boolean iHadIntermediatePt, Boolean iIsSignedProjection)
Calculates the projection of a SMultiline on an SPoly with a direction.
SeparateTriBoxSelectEnum
Definition: SPoly.h:149
@ SEPARATETRIBOX_KEEP_OUTSIDE_TRI
Definition: SPoly.h:151
@ SEPARATETRIBOX_KEEP_INSIDE_TRI
Definition: SPoly.h:150
@ SEPARATETRIBOX_KEEP_BOTH
Definition: SPoly.h:152
Array ExtractCylinder(Array< SPoint > iSeedPoint, Number iTolerance, CylinderEnum iForce, SPoint iCenter={}, SVector iDirectionVector={}, Number iRadius)
Extract the cylindrical region on the current polyhedron starting from a seed point.
Array Explode()
Explodes a compound mesh into several parts.
Array RemeshRefineDev(Number iDeviation, Number iSizeMin, Number iMaxiTriNumber, BordersEnum iBorderOption, Number iDistanceWrongPoints, Number iReorganize, SCloud iCloud, Number iMaxCosAngle=-1)
Refines an existing SPoly with deviation error and optionally better fitting on a SCloud.
FusionOptionEnum
Definition: SPoly.h:1889
@ SIMPLE
Definition: SPoly.h:1890
@ REMESH
Definition: SPoly.h:1891
@ FILL_HOLES
Definition: SPoly.h:1892
Array Offset(Boolean iIsDirect, Number iDistCoef, OffsetEnum iOptBitMask)
Calculates and returns a new parallel polyhedron.
SegmentationFeaturesEnum
Definition: SPoly.h:156
@ SEGMENTATION_CONE
Definition: SPoly.h:159
@ SEGMENTATION_SPHERE
Definition: SPoly.h:158
@ SEGMENTATION_PLANE
Definition: SPoly.h:157
@ SEGMENTATION_CYLINDER
Definition: SPoly.h:160
static Array All(Number iVisCrit)
To get all the SComp in the document.
Definition: SPoly.h:1961
static Array CreateCompound(Array< SPoly > iTablePoly, Boolean iOptOrient)
Make a compound SPoly from a table of SPoly.
RotateEnum
How the extrusion rotate point is compute.
Definition: SPoly.h:1899
@ ROTATE_CENTROID
Definition: SPoly.h:1901
@ ROTATE_AUTO
Definition: SPoly.h:1900
@ ROTATE_INTERSECTION
Definition: SPoly.h:1902
static Array JoinContour(Array< SMultiline > iMultiLines, Array< SPoly > iPolyhedrons, Number iTangency1, Number iTangency2, Number iTension=0.732, Boolean iReorganize, Number iNbPoint)
Create a meshed surface from two contours or mesh holes, which optionally preserves tangency continui...
Array DestructTrianglesOnHoles(SCloud iCloud, Number iHoleSize, Number iMaxDistToCloud=0.f, Number iOptions, Number iMaxCosAngle=-1)
Remove triangles which are considered over a hole of a certain diameter regarding iCloud.
Array ProjDir(SPoint iPoint, SVector iDirection, Boolean iIsSignedProjection)
Calculates the projection of a point on an SPoly with a direction. The point to project is considered...
Array GetLowestPoint(SVector iDirection)
Get the lowest point according to the Direction.
Array Compare(SPoly iMeasPoly, Number iDistMax, Number iMappingObject, Boolean iIsIgnoreEdge, SVector iDirection, Number iMaxCosAngle=0., Boolean iIsCheckThinParts)
Calculates the distances between 2 components for further inspection purpose (color mapping)
Array Contours(Boolean iIsExportSuspiciousTriangles=false)
static Array ColorAlongDir(Array< SPoly > iMeshes, SVector iDirectionVect, SPoint iOrigin={})
Color the mesh along a direction with a gradient.
Array GetInertiaMatrix(Boolean iIsOnlyIfClosed)
Calculates the solid's inertia matrix.
Array Compare(SCloud iMeasCloud, Number iDistMax, Number iMappingObject, Boolean iIsIgnoreEdge, SVector iDirection, Number iMaxCosAngle=-2, Boolean iIsCheckForThinParts)
Calculates the distances between 2 components for further inspection purpose (color mapping)
SeparateTriBoxEnum
Definition: SPoly.h:142
@ SEPARATETRIBOX_STRICLTY_INSIDE
Definition: SPoly.h:143
@ SEPARATETRIBOX_ONLY_CROSSING
Definition: SPoly.h:144
@ SEPARATETRIBOX_CROSSING_AND_INSIDE
Definition: SPoly.h:145
Array BooleanAdd(SPoly iPoly)
To make a boolean addition with the current SPoly.
Array LocalizeValues(Array< Number > iThresholdList)
Extract the points or the lines at threshold values of an inspected mesh.
Array RemeshSharpEdge(Array< SMultiline > iLines, SPoint iReferencePoint)
Modifies locally the existing mesh to recreate sharp edge(s)
Array FillContours(Array< SMultiline > iContourTable, Number iTension=0.732f, Number iWallThickness=-1, Boolean iIsForceNonSmoothShape)
3D Hole filling. The function creates triangles on the edges of the holes to fill the concave parts.
SphereEnum
Bit mask to know which parameter(s) are forced and do not need to be computed.
Definition: SPoly.h:114
@ SPHERE_FORCE_RADIUS
Definition: SPoly.h:116
@ SPHERE_FORCE_NOTHING
Definition: SPoly.h:115
Array BooleanCommon(SPoly iPoly)
To get the boolean common part between two closed volumes (the current object and a given parameter).
Array ReduceDeviation(Number iDeviationError, DeviationOptionEnum iCriteria, Boolean iIsKeepSharpEdge, Number iDeviationOnSharpEdges, Number iSharpEdgeAngleValue, Number iMaxEdgeLength, Number iDeviationOnBorders)
Reduces the mesh by deleting some vertices and triangles according to a deviation error.
Array GetNumberOfTextures()
Returns the number of textures applied to the mesh.
Array TextureAddRepetitive(String iFilePathName, Number iNbRepWidth, Number iNbRepHeight, SVector iDirXScreen, SVector iDirYScreen, SPoint iImageOrigin)
Adds repetitive texture to a mesh.
static SPoly New(SPoly iOther)
Constructs an SPoly by copying the SPoly Other.
Array GetSilhouette(SVector iViewDirection, Number iDraftAngle, Number iMinClosedLine, Number iMinUnclosedLine, Number iResultType)
Calculates the silhouette or external contour of a SPoly according to a direction and possibly a draf...
static Array DirectionMesh(SCloud iCloudOfPoints, SVector iMeshingDirection, Number iTolerance, Boolean iIsFindCntr)
Meshes a cloud of points according to a certain tolerance and direction (2D1/2 meshing)
Array BooleanSub(SPoly iPoly)
To make a boolean subtraction with the current object.
Array ExplodeWithInspectionSteps()
Split the mesh according to the inspection steps.
Array BooleanOperation(SPoly iPoly, Boolean iIsCutPoly)
To make a boolean operation between two SPoly.
Array BooleanCutOut(SPoly iPoly)
To cut the current SPoly against the parameter SPoly and keep the part of the current SPoly that is O...
Array RemoveTexture()
Removes all textures applied on the current mesh.
Array VolumeFromElevation(Array< Number > iElevations, SVector iProjDir={ 0., 0., 1. })
Calculate the Polyhedron volume above and below the given elevation.
Array SaveColorGradient(String iFilePath)
Saves the color gradient into a file (*.rsi binary file).
Definition: SPoly.h:1270
Array ExtractFeatureLines(Number iSmoothingIntensity=0.0)
Extract all the feature lines on the mesh.
Array SectionPlane(SVector iPlaneNormal, SPoint iPtFirstPlane, Number iNbPlanes, Number iDistance)
Intersection between an SPoly and a parallel plane.
Array SectionOnMulti(SMultiline iMultiLine, Array< Number > iListDist, Number iMaxDist, Number iOptBitMask)
Compute the sections of a SPoly (for example a tube or a tunnel) along a SMultiline (normal to the SM...
Array GetColorGradient()
To get the color gradient of the SPoly.
Definition: SPoly.h:1227
Array SectionRadial(SPoint iFirstPointOnAxis, SPoint iSecondPointOnAxis, SPoint iPtFirstPlane, Number iNbSections, Number iMaxAngleInRadian)
Intersection of a Polyhedron by radial planes.
The mathematical object vector.
Definition: SVector3.h:26