Class Algo
- Namespace
Methods
assembleCAD
Assemble faces of CAD shapes
algo.assembleCAD(occurrences, tolerance=0.1, removeDuplicatedFaces=True)
Parameters
occurrencesOccurrenceListOccurrences of components to assemble
toleranceDistanceAssembling tolerance
removeDuplicatedFacesBooleanIf True, duplicated faces will be removed
backToInitialBRep
Create the BRep shape from a Tessellated shape with Domain Patch Attributes (after tessellate)
algo.backToInitialBRep(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
bakeImpostor
bakes impostors textures
algo.bakeImpostor(occurrence, XFrames, YFrames, hemi, resolution, padding, roughness, metallic, ao) -> algo.OctahedralImpostor
Parameters
occurrenceOccurrenceXFramesIntYFramesInthemiBoolresolutionIntpaddingIntroughnessBooleanmetallicBooleanaoBoolean
Returns
- OctahedralImpostor
The structure containing impostor data
bakeVertexAttributes
Bake vertex attributes on meshes from other meshes
algo.bakeVertexAttributes(destinationOccurrences, sourceOccurrences=[], skinnedMesh=True, positions=False, useCurrentPositionAsTPose=False)
Parameters
destinationOccurrencesOccurrenceListOccurrences of the meshes where to store the baked vertex attributes
sourceOccurrencesOccurrenceListOccurrences of components from which to bake vertex attributes
skinnedMeshBooleanEnabling skinned mesh baking (joint assignation for animation transfer)
positionsBooleanEnabling vertex position baking
useCurrentPositionAsTPoseBooleanUse the current position as the T-Pose
calculateNormalsInPointClouds
calculate the normal of each point of a Point Cloud
Warning
This function is tagged as EXPERIMENTAL.
algo.calculateNormalsInPointClouds(occurrences)
Parameters
occurrencesOccurrenceListPart occurrences to process
combineMeshesByMaterials
Explode and (re)merge a set of mesh parts by visible materials
algo.combineMeshesByMaterials(occurrences, mergeNoMaterials, mergeHiddenPartsMode) -> scene.OccurrenceList
Parameters
occurrencesOccurrenceListOccurrences of the parts to merge
mergeNoMaterialsBooleanIf true, merge all parts with no active material together, else do not merge them
mergeHiddenPartsModeMergeHiddenPartsModeHidden parts handling mode, Destroy them, make visible or merge separately
Returns
- OccurrenceList
Resulting occurrences of the merged parts
configureFunctionLogger
algo.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters
crackCADMoebiusStrip
Detect Moebius strip and crack them if there is somme of them in the selection
algo.crackCADMoebiusStrip(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to check
crackEdges
crack polygonal edges according to given criteria (deprecated, use crackMeshEdges instead)
Warning
This function is tagged as DEPRECATED.
algo.crackEdges(occurrences, useAttributesFilter=True, sharpAngleFilter=45, useNonManifoldFilter=False)
Parameters
occurrencesOccurrenceListOccurrences of components to process
useAttributesFilterBooleanFilters by attribute
sharpAngleFilterAngleSharp angle in degree to filter by edges sharpness, if the angle is negative do not filter
useNonManifoldFilterBooleanFilters by manifold-ness.
crackMeshEdges
crack polygonal edges according to given criteria
algo.crackMeshEdges(occurrences, normal=False, uvs=False, uvChannels, loi=False, patches=False, nman=False)
Parameters
occurrencesOccurrenceListOccurrences of components to process
normalBooleanCrack on sharp normals
uvsBooleanCrack on UV seams
uvChannelsIntListIf empty and uvs=true, crack all UV channel, else only channel specified in the list
loiBooleanCrack on identifier Lines of Interests
patchesBooleanCrack on patch borders
nmanBooleanCrack on non-manifolds
createFreeEdgesFromPatches
Create free edges from patch borders
algo.createFreeEdgesFromPatches(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
createIdentifiedPatchesFromPatches
Create identified patch from existing patch (this is useful before cloning for baking)
algo.createIdentifiedPatchesFromPatches(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
createIndexMapFromOccurrences
Create an IndexMap and add an UVSet so that each mesh will have UVs refering to one different pixel of the index map and that pixel will have the value i for occurrences[i]. Warning: all occurrences will be singularized
algo.createIndexMapFromOccurrences(occurrences, uvChannel, createTexture1D) -> material.Image
Parameters
occurrencesOccurrenceListuvChannelIntcreateTexture1DBoolIf true, the texture will have a resolution of 1 x occurrences.size, else a square power of two image will be created to fit occurrences.size pixels
Returns
createNormals
Create normal attributes on tessellations
algo.createNormals(occurrences, sharpEdge=45, override=True, useAreaWeighting=False)
Parameters
occurrencesOccurrenceListOccurrences of components to create attributes
sharpEdgeAngleEdges with an angle between their polygons greater than sharpEdge will be considered sharp. If negative, smooth normals only.
overrideBooleanIf true, override existing normals, else only create normals on meshes without normals
useAreaWeightingBooleanIf true, normal computation will be weighted using polygon areas
createPointCloudKDTree
Create a KD-Tree from some point clouds occurrence, the given occurrences are deleted (even if they contains triangles) and the KD-Tree is represented in a new occurrence sub tree
algo.createPointCloudKDTree(occurrences, depth, addToScene) -> scene.Occurrence
Parameters
occurrencesOccurrenceListOccurrences to process
depthIntKd tree depth
addToSceneBoolAdd the KD-Tree to the current scene
Returns
- Occurrence
KD-Tree root occurrence
createTangents
Create tangent attributes on tessellations
algo.createTangents(occurrences, uvChannel=0, override=True)
Parameters
occurrencesOccurrenceListOccurrences of components to create attributes
uvChannelIntUV channel to use for the tangents creation
overrideBooleanIf true, override existing tangents, else only create tangents on meshes without tangents
createVertexColorFromMaterials
Bake vertex colors using main material color. May duplicate some vertices
algo.createVertexColorFromMaterials(occurrenceList)
Parameters
occurrenceListOccurrenceList
createVisibilityPatchesFromPatch
Create visibility patches from existing patches
algo.createVisibilityPatchesFromPatch(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
decimate
reduce the polygon count by removing some vertices
algo.decimate(occurrences, surfacicTolerance=1, lineicTolerance=0.1, normalTolerance=5, texCoordTolerance=-1, releaseConstraintOnSmallArea=False)
Parameters
occurrencesOccurrenceListOccurrences of components to process
surfacicToleranceDistanceMaximum distance between surfacic vertices and resulting simplified surfaces
lineicToleranceDistanceMaximum distance between lineic vertices and resulting simplified lines
normalToleranceAngleMaximum angle between original normals and those interpolated on the simplified surface
texCoordToleranceDistanceMaximum distance (in 3D space) between original texcoords and those interpolated on the simplified surface
releaseConstraintOnSmallAreaBooleanIf True, release constraint of normal and/or texcoord tolerance on small areas (according to surfacicTolerance)
decimateEdgeCollapse
reduce the polygon count by collapsing some edges to obtain an simplified mesh
Warning
This function is tagged as EXPERIMENTAL.
algo.decimateEdgeCollapse(occurrences, surfacicTolerance=0.1, boundaryWeight=1., normalWeight=1., UVWeight=1., sharpNormalWeight=1., UVSeamWeight=10., normalMaxDeviation=-1, forbidUVOverlaps=True, UVMaxDeviation=-1, UVSeamMaxDeviation=-1, protectTopology=False, qualityTradeoff=0)
Parameters
occurrencesOccurrenceListOccurrences of components to process
surfacicToleranceDistanceError max between the simplified mesh et the old one
boundaryWeightDoubleBoundary importance during the decimation
normalWeightDoubleNormal importance during the decimation
UVWeightDoubleUV importance during the decimation
sharpNormalWeightDoubleImportance of sharp edges during the decimation
UVSeamWeightDoubleImportance of UV seams during the decimation
normalMaxDeviationAngleConstraint the normals deviation on decimated model
forbidUVOverlapsBooleanForbid UV to fold over and overlap during the decimation
UVMaxDeviationDoubleConstraint the uv deviation on decimated model
UVSeamMaxDeviationDoubleConstraint the uv seams deviation on decimated model
protectTopologyBooleanIf false, the topology of the mesh can change and some edges can become non-manifold. But the visual quality will be better on model with complex topology
qualityTradeoffQualitySpeedTradeoffFor big models it is recommended to choose PreferSpeed tradeoff. In PreferSpeed mode, quadrics are computed only on position (and not on other vertex attributes)
decimatePointClouds
decimate Point Cloud Occurrences according to tolerance
algo.decimatePointClouds(occurrences, tolerance=500)
Parameters
occurrencesOccurrenceListPart occurrences to process
toleranceDistanceAvarage distance between points
decimateTarget
reduce the polygon count by collapsing some edges to obtain a target triangle count (iterative version that use less memory)
algo.decimateTarget(occurrences, targetStrategy, UVImportance=0, protectTopology=False, iterativeThreshold=5000000, processMeshIndependently=False)
Parameters
occurrencesOccurrenceListList of occurrences to process
targetStrategyDecimateOptionsSelectorSelect between targetCount or ratio to define the number of triangles left after the decimation process
UVImportanceUVImportanceEnumSelect importance of texture coordinates
protectTopologyBooleanIf False, the topology of the mesh can change and some edges can become non-manifold
iterativeThresholdULongNumber of triangles above which the iterative algorithm is used to limit the memory usage (disabled if processMeshIndependently=True)
processMeshIndependentlyBooleanIf true, each mesh will be processed independently and the triangleCount or ratio will apply by mesh (disable iterative method)
deleteAttibute
Delete designed attribute on tessellations
algo.deleteAttibute(occurrence, type)
Parameters
occurrenceOccurrenceOccurrence to detele attribute from
typeAttributTypeAttribute type
deleteBRepShapes
Delete BRep representation on parts
algo.deleteBRepShapes(occurrences, onlyTessellated=True)
Parameters
occurrencesOccurrenceListOccurrences of components to process
onlyTessellatedBooleanIf True, delete only BRep represensation on part with a tessellated shape
deleteFreeVertices
Delete all free vertices of the mesh of given parts
algo.deleteFreeVertices(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
deleteLines
Delete all free line of the mesh of given parts
algo.deleteLines(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
deleteNormals
Remove normal attributes on tessellations
algo.deleteNormals(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to delete
deletePatches
Delete patches attributes on tessellations
algo.deletePatches(occurrences, keepOnePatchByMaterial=True)
Parameters
occurrencesOccurrenceListOccurrences of components to process
keepOnePatchByMaterialBooleanIf set, one patch by material will be kept, else all patches will be deleted and materials on patches will be lost
deletePolygons
Delete all polygons of the mesh of given parts
algo.deletePolygons(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
deleteTangents
Remove tangent attributes on tessellations
algo.deleteTangents(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to delete
deleteTextureCoordinates
Delete texture coordinates on tessellations
algo.deleteTextureCoordinates(occurrences, channel=-1)
Parameters
occurrencesOccurrenceListOccurrences of components to process
channelIntChoose Texture coordinates channel to delete (-1 for all channels)
deleteVisibilityPatches
delete the visibility patches of given occurrences
algo.deleteVisibilityPatches(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
evalDecimateErrorForTarget
returns the max error to set to reach a given target
algo.evalDecimateErrorForTarget(occurrences, TargetStrategy, boundaryWeight, normalWeight, UVWeight, sharpNormalWeight, UVSeamWeight, forbidUVFoldovers, protectTopology) -> core.Double
Parameters
occurrencesOccurrenceListList of occurrences to process
TargetStrategyDecimateOptionsSelectorSelect between targetCount or ratio to define the number of triangles left after the decimation process
boundaryWeightDoubleDefines how important the edges defining the mesh boundaries (free edges) are during the decimation process, to preserve them from distortion
normalWeightDoubleDefines how important vertex normals are during the decimation process, to preserve the smoothing of the mesh from being damaged
UVWeightDoubleDefines how important UVs (texture coordinates) are during the decimation process, to preserve them from being distorted (along with the textures using the UVs)
sharpNormalWeightDoubleDefines how important sharp edges (or hard edges) are during the decimation process, to preserve them from being distorted
UVSeamWeightDoubleDefines how important UV seams (UV islands contours) are during the decimation process, to preserve them from being distorted (along with the textures using the UVs)
forbidUVFoldoversBooleanForbids UVs to fold over and overlap each other during the decimation
protectTopologyBooleanIf False, the topology of the mesh can change and some edges can become non-manifold; but the visual quality will be better on model with complex topology
Returns
- Double
Max error that can be used in decimateEdgeCollapse function
extractNeutralAxis
Extract neutral axis from tessellations
algo.extractNeutralAxis(occurrences, maxDiameter=100, removeOriginalMesh=True)
Parameters
occurrencesOccurrenceListOccurrences of components to process
maxDiameterDistanceMaximum diameter of beams
removeOriginalMeshBooleanRemove or not the original mesh at the end of the algorithm
filletMesh
Fillet a mesh according to its Lines of Interest
Warning
This function is tagged as EXPERIMENTAL.
algo.filletMesh(occurrences, value, filletingMode=0, subdivisionNb=0, createFlatChamfer=False, material)
Parameters
occurrencesOccurrenceListInput occurrences
valueDoubleValue (mm)
filletingModeFilletingModeFilleting mode
subdivisionNbIntNumber of subdivision
createFlatChamferBooleanIf there is 0 subdivision, should the fillet be a planar flat chamfer?
materialMaterialMaterial to apply to created fillets. Default: use a random neighbor material
filterHiddenPolygons
remove hidden polygons using voxels and cavities
algo.filterHiddenPolygons(occurrences, voxelSize=50)
Parameters
occurrencesOccurrenceListPart occurrences to process
voxelSizeDistanceSize of voxels
getAllAxisFromCADModel
Return all the main axis contained in the CAD models given
algo.getAllAxisFromCADModel(occurrences) -> scene.OccurrenceList, geom.Matrix4ListList
Parameters
occurrencesOccurrenceListOccurrences of components to check
Returns
- OccurrenceList
Occurrence part that contained CAD part
getOptimalTextureResolution
Returns the optimal resolution based on a number of texels per 3D space units (e.g : mm)
Warning
This function is tagged as EXPERIMENTAL.
algo.getOptimalTextureResolution(occurrences, texelPerMm) -> core.Int
Parameters
occurrencesOccurrenceListOccurrences on which to compute optimal texture resolution
texelPerMmDoubleNumber of texel per millimeter in a 3D space
Returns
getTessellations
returns all the tessellation of the given occurrences (only returns editable mesh, see algo.toEditableMesh)
algo.getTessellations(occurrences) -> polygonal.TessellationList
Parameters
occurrencesOccurrenceListOccurrences of components to process
Returns
- TessellationList
All the tessellation of the given occurrences
getUV3dRatio
Returns the ratio of size between UV and 3D (max value, actually at the 90th percentil)
Warning
This function is tagged as EXPERIMENTAL.
algo.getUV3dRatio(occurrences) -> core.Double
Parameters
occurrencesOccurrenceListOccurrences on which to compute optimal texture resolution
Returns
- Double
Equivalent size of 1 in the UV space in 3D (e.g. Ratio/resolution give the 3D size of a texel))
getVisibilityStats
returns the visibility statistics for some occurrences
algo.getVisibilityStats(occurrences) -> core.Int, core.Int
Parameters
occurrencesOccurrenceListOccurrences of components to process
Returns
identifyPatches
Create cad patches on tessellation (needed by some functions)
algo.identifyPatches(occurrences, useAttributesFilter=True, sharpAngleFilter=45, useBoundaryFilter=True, useNonManifoldFilter=True, useLineEdgeFilter=True, useQuadLineFilter=False)
Parameters
occurrencesOccurrenceListOccurrences of components to process
useAttributesFilterBooleanFilters by attributes
sharpAngleFilterAngleSharp angle in degree to filter by edges sharpness, if the angle is negative do not filter
useBoundaryFilterBooleanFilters by boundaries
useNonManifoldFilterBooleanFilters by manifold-ness
useLineEdgeFilterBooleanFilters by edge
useQuadLineFilterBooleanFilters by quad lines
identifySharpEdges
Mark as Lines Of Interest the sharp edges
Warning
This function is tagged as EXPERIMENTAL.
algo.identifySharpEdges(occurrences, minSharpAngle=90, maxSharpAngle=180, convexity=2, onlyExplicitSharp=False)
Parameters
occurrencesOccurrenceListInput occurrences
minSharpAngleAngleThe angle between the normals - all edges sharpest than this will be filleted
maxSharpAngleAngleAll edges sharpest than this won't be filleted
convexityConvexityFilterFillet sharp edges that are convex, concave or both
onlyExplicitSharpBooleanIf toggled, if the explicit normals of an edge says the transition is smooth, the edge won't be selected
lineToTexture
Generate a textured quadrangle over an existing mesh of coplanar lines
Warning
This function is tagged as EXPERIMENTAL.
algo.lineToTexture(lines, useColor, resolution=512, thickness=5)
Parameters
linesOccurrenceListLines to select
useColorUseColorOptionSet color policy.
resolutionIntTexture resolution
thicknessIntThe thickness of the lines in pixels
listFeatures
List features from tessellations
algo.listFeatures(occurrences, throughHoles, blindHoles, maxDiameter) -> algo.OccurrenceFeaturesList
Parameters
occurrencesOccurrenceListOccurrences of components to process
throughHolesBooleanList through holes
blindHolesBooleanList blind holes
maxDiameterDistanceMaximum diameter of the holes to be list (-1=no max diameter)
Returns
- OccurrenceFeaturesList
List of features by occurrence
loopSubdivMesh
Apply Loop Subdivision on Triangle-only Mesh
algo.loopSubdivMesh(occurrences, depth=1)
Parameters
occurrencesOccurrenceListOccurrences of components to process
depthIntSubdivision depth
mergeVertices
merge near vertices according to the given distance
algo.mergeVertices(occurrences, maxDistance, mask)
Parameters
occurrencesOccurrenceListOccurrences of components to process
maxDistanceDistanceMaximum distance between two vertex to merge
maskTopologyCategoryMaskTopological category of the vertices to merge
meshComparison
compare two meshes
Warning
This function is tagged as EXPERIMENTAL.
algo.meshComparison(mesh_1, mesh_2) -> geom.Distance
Parameters
mesh_1Occurrencemesh_2Occurrence
Returns
- Distance
Disance between two meshes
meshComparisonBatch
compare each couple of meshes and returns the maximum for each couple
Warning
This function is tagged as EXPERIMENTAL.
algo.meshComparisonBatch(meshes1, meshes2) -> geom.DistanceList
Parameters
meshes1OccurrenceListmeshes2OccurrenceList
Returns
- DistanceList
Disance between each couple of meshes
meshIntersections
Computes the intersections between the meshes of two occurrences
Warning
This function is tagged as EXPERIMENTAL.
algo.meshIntersections(occurrence1, occurrence2) -> geom.Point3ListList
Parameters
occurrence1OccurrenceFirst Occurrence
occurrence2OccurrenceSecond Occurrence
Returns
- Point3ListList
The intersections
noiseMesh
Apply noise to vertex positions along their normals
algo.noiseMesh(occurrences, maxAmplitude=1)
Parameters
occurrencesOccurrenceListPart occurrencess to noise
maxAmplitudeDistanceMaximum distance between original vertex and noisy vertex
optimizeCADLoops
Optimize CAD Face loops by merging useless loop edges
algo.optimizeCADLoops(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to optimize
optimizeForRendering
Optimize mesh for rendering (lossless, only reindexing)
algo.optimizeForRendering(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to optimize
optimizeSubMeshes
Sort sub meshes by materials
algo.optimizeSubMeshes(occurrences)
Parameters
occurrencesOccurrenceListPart occurrencess to process
optimizeTextureSize
Resizes scene textures based on a number of texels per 3D space units (e.g: mm)
Warning
This function is tagged as EXPERIMENTAL.
algo.optimizeTextureSize(root, texelPerMm=2)
Parameters
rootOccurrenceRoot from which texture resizing will process
texelPerMmDoubleNumber of texel per millimeter in a 3D space
removeHoles
Remove some features from tessellations
algo.removeHoles(occurrences, throughHoles=True, blindHoles=False, surfacicHoles=False, maxDiameter=-1, fillWithMaterial=0)
Parameters
occurrencesOccurrenceListOccurrences of components to process
throughHolesBooleanRemove through holes
blindHolesBooleanRemove blind holes
surfacicHolesBooleanRemove surfacic holes
maxDiameterDistanceMaximum diameter of the holes to be removed (-1=no max diameter)
fillWithMaterialMaterialIf set, the given material will be used to fill the holes
repairCAD
Repair CAD shapes, assemble faces, remove duplicated faces, optimize loops and repair topology
algo.repairCAD(occurrences, tolerance=0.1, orient=True)
Parameters
occurrencesOccurrenceListOccurrences of components to clean
toleranceDistanceTolerance
orientBooleanIf true reorient the model
setFeatureComponentMaxIndex
Remap Index map of each FeatureComponent of selected occurrences
algo.setFeatureComponentMaxIndex(occurrences, maxIndex)
Parameters
occurrencesOccurrenceListmaxIndexInt
smoothMesh
algo.smoothMesh(occurrences, mode, maxIterations=100, lockSignificantEdges=True)
Parameters
occurrencesOccurrenceListOccurrences of components to process
modeCostEvaluationComputation of cost
maxIterationsIntMaximum number of swapping iteration
lockSignificantEdgesBooleanForbid to swap significant edges (e.g. UV seams, sharp edges, patch borders, ...)
splitUVForAtlas
algo.splitUVForAtlas(occurrences)
Parameters
occurrencesOccurrenceListInput occurrences
sweep
Extrudes a circular section along an underlying polyline (curve)
Warning
This function is tagged as EXPERIMENTAL.
algo.sweep(occurrences, radius=1, sides=10, createNormals=True, keepLines=False, generateUV=True)
Parameters
occurrencesOccurrenceListOccurrences of components to check
radiusDistanceRadius of cylinders
sidesIntNumber of points to create cylinders
createNormalsBooleankeepLinesBooleangenerateUVBoolean
tessellate
Create a tessellated representation from a CAD representation for each given part
algo.tessellate(occurrences, maxSag=0.2, maxLength=-1, maxAngle=-1, createNormals=True, uvMode=0, uvChannel=1, uvPadding=0.0, createTangents=False, createFreeEdges=False, keepBRepShape=True, overrideExistingTessellation=False)
Parameters
occurrencesOccurrenceListOccurrences of components to tessellate
maxSagDistanceMaximum distance between the geometry and the tessellation
maxLengthDistanceMaximum length of elements
maxAngleAngleMaximum angle between normals of two adjacent elements
createNormalsBooleanIf true, normals will be generated
uvModeUVGenerationModeSelect the texture coordinates generation mode
uvChannelIntThe UV channel of the generated texture coordinates (if any)
uvPaddingDoubleThe UV padding between UV island in UV coordinate space (between 0-1). This parameter is handled as an heuristic so it might not be respected
createTangentsBooleanIf true, tangents will be generated
createFreeEdgesBooleanIf true, free edges will be created for each patch borders
keepBRepShapeBooleanIf true, BRep shapes will be kept for Back to Brep or Retessellate
overrideExistingTessellationBooleanIf true, already tessellated parts will be re-tessellated
tessellatePointClouds
Tessellate point clouds to replace the geometry with a polygonal connect mesh
Warning
This function is tagged as EXPERIMENTAL.
algo.tessellatePointClouds(occurrences, kNeighbors=20, keepPoints=False, colorize=True)
Parameters
occurrencesOccurrenceListkNeighborsIntThe number of neighbor points used to compute normals
keepPointsBooleanKeep points after meshing if enabled
colorizeBooleanIf enabled, vertex colors will be generated on the resulting mesh
tessellateRelativelyToAABB
Creates a tessellated representation from a CAD representation for each given part. It multiplies the length of the diagonal of the bounding box by the sagRatio. If the output value is above maxSag, then maxSag is used as tessellation value. Else if the output value is below maxSag, it is used as tessellation value.
algo.tessellateRelativelyToAABB(occurrences, maxSag=0.2, sagRatio=0.001, maxLength=-1, maxAngle=-1, createNormals=True, uvMode=0, uvChannel=1, uvPadding=0.0, createTangents=False, createFreeEdges=False, keepBRepShape=True, overrideExistingTessellation=False)
Parameters
occurrencesOccurrenceListOccurrences of components to tessellate
maxSagDistanceMaximum distance between the geometry and the tessellation
sagRatioDoubleMaximum ratio distance between the geometry and the tessellation
maxLengthDistanceMaximum length of elements
maxAngleAngleMaximum angle between normals of two adjacent elements
createNormalsBooleanIf true, normals will be generated
uvModeUVGenerationModeSelect the texture coordinates generation mode
uvChannelIntThe UV channel of the generated texture coordinates (if any)
uvPaddingDoubleThe UV padding between UV island in UV coordinate space (between 0-1). This parameter is handled as an heuristic so it might not be respected
createTangentsBooleanIf true, tangents will be generated
createFreeEdgesBooleanIf true, free edges will be created for each patch borders
keepBRepShapeBooleanIf true, BRep shapes will be kept for Back to Brep or Retessellate
overrideExistingTessellationBooleanIf true, already tessellated parts will be re-tessellated
voxelizePointClouds
Explode point clouds to voxels
algo.voxelizePointClouds(occurrences, voxelSize=500)
Parameters
occurrencesOccurrenceListPart occurrences to process
voxelSizeDistanceSize of voxels
bakeUV
algo.bakeUV(source, destination, sourceChannel=0, destinationChannel=0, tolerance=0.001)
Parameters
sourceOccurrenceOccurrence of the source mesh
destinationOccurrenceOccurrence of the destination mesh
sourceChannelIntSource UV channel to bake
destinationChannelIntDestination UV channel to bake to
toleranceDistanceTolerance when point is projected on seam (if the model come from a decimation it is recommended to use the lineic tolerance here)
combineMaterials
Combine all given meshes to one mesh with one material (baked)
See also:
algo.combineMaterials(occurrences, bakingOptions, overrideExistingUVs=True, singularizeOnAO=False)
Parameters
occurrencesOccurrenceListPart occurrences to process
bakingOptionsBakeOptionBaking options
overrideExistingUVsBooleanIf True, override existing UVs on channel
singularizeOnAOBooleanIf true, singularize all instances in the selected subtree if we want to bake AO in the texture
combineMeshes
Combine all given meshes to one mesh with one material (baked)
See also:
algo.combineMeshes(occurrences, bakingOptions, overrideExistingUVs) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
bakingOptionsBakeOptionBaking options
overrideExistingUVsBooleanIf True, override existing UVs on channel
Returns
convexDecomposition
Explode each mesh to approximated convex decomposition
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.convexDecomposition(occurrences, maxCount, vertexCount, approximate, resolution, concavity) -> scene.OccurrenceList
Parameters
occurrencesOccurrenceListPart occurrences to process
maxCountIntMaximum number of convex hull to generated
vertexCountIntMaximum number of vertices per convex hull
approximateBooleanApproximate method
resolutionIntResolution
concavityDoubleConcavity
Returns
- OccurrenceList
Resulting occurrences of the convexDecomposition
explodeBodies
Explode all CAD Parts by body. New parts will be placed as children of input part occurrences.
See also:
algo.explodeBodies(occurrences, groupOpenShells=False)
Parameters
occurrencesOccurrenceListPart occurrences to process
groupOpenShellsBooleanGroup all open shells in one part
explodeByMaterials
Explode all parts by material. New parts will be placed as children of input part occurrences.
See also:
algo.explodeByMaterials(occurrences)
Parameters
occurrencesOccurrenceListPart occurrences to process
explodeByVertexCount
Explode part occurrences to respect a maximum vertex count
See also:
algo.explodeByVertexCount(occurrences, maxVertexCount=65534, maxTriangleCount=65534, countMergedVerticesOnce=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
maxVertexCountIntThe maximum number of vertices by part
maxTriangleCountIntThe maximum number of triangles by part (quadrangles count twice)
countMergedVerticesOnceBooleanIf true, one vertex used in several triangles with different normals will be counted once (for Unity must be False)
explodeByVoxel
Explode parts by voxel. New parts will be placed as children of input part occurrences.
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.explodeByVoxel(occurrences, voxelSize=500)
Parameters
occurrencesOccurrenceListPart occurrences to process
voxelSizeDistanceVoxel size
explodeConnectedMeshes
Explode connected set of polygons to part occurrences. New parts will be placed as children of input part occurrences.
See also:
algo.explodeConnectedMeshes(occurrences)
Parameters
occurrencesOccurrenceListPart occurrences to process
explodePatches
Explode all parts by patch
See also:
algo.explodePatches(occurrences)
Parameters
occurrencesOccurrenceListPart occurrences to process
legoDecomposition
Decompose a model in a set of lego bricks
algo.legoDecomposition(root, bricks, colors, density, forceFillingWithSmallBricks) -> algo.LegoReturn
Parameters
rootOccurrenceThe model root occurrence
bricksLegoBrickDefinitionListcolorsColorListdensityIntforceFillingWithSmallBricksBoolean
Returns
- LegoReturn
The root occurrence of the decomposition and the list of bricks used
createVisibilityInformation
Create visilibity information on part occurrences viewed from a set of camera automatically placed on a sphere around the scene
See also:
- algo.createVisibilityInformationAdvanced
- algo.createVisibilityInformationFromViewPoints
- algo.findOccludedPartOccurrences
- algo.findOccludedPartOccurrencesAdvanced
- algo.removeOccludedGeometries
- algo.removeOccludedGeometriesAdvanced
- algo.removeOccludedGeometriesFromPoints
- algo.removeOccludedGeometriesFromViewPoints
algo.createVisibilityInformation(occurrences, level=0, resolution=1024, sphereCount=16, fovX=90, considerTransparentOpaque=False, root=0)
Parameters
occurrencesOccurrenceListOccurrences of components to process
levelSelectionLevelLevel of geometries to remove : Parts, Patches or Polygons
resolutionIntResolution of the visibility viewer
sphereCountIntSegmentation of the sphere sphereCount x sphereCount
fovXDoubleHorizontal field of view (in degree)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
rootOccurrenceSpecify another root for occluder scene
createVisibilityInformationAdvanced
Create visilibity information on part occurrences viewed from a set of voxel based view points.
See also:
- algo.createVisibilityInformation
- algo.createVisibilityInformationFromViewPoints
- algo.findOccludedPartOccurrences
- algo.findOccludedPartOccurrencesAdvanced
- algo.removeOccludedGeometries
- algo.removeOccludedGeometriesAdvanced
- algo.removeOccludedGeometriesFromPoints
- algo.removeOccludedGeometriesFromViewPoints
algo.createVisibilityInformationAdvanced(occurrences, voxelSize=100, minimumCavityVolume=1, resolution=256, mode=0, considerTransparentOpaque=False, root=0)
Parameters
occurrencesOccurrenceListOccurrences of components to process
voxelSizeDistanceSize of the voxels in mm (smaller it is, more viewpoints there are)
minimumCavityVolumeVolumeMinimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are)
resolutionIntResolution of the visibility viewer
modeInnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
rootOccurrenceSpecify another root for occluder scene
createVisibilityInformationFromViewPoints
Create visilibity information on parts viewed from a given set of camera
See also:
algo.createVisibilityInformationFromViewPoints(occurrences, cameraPositions, cameraDirections, cameraUps, resolution=1024, fovX=90, considerTransparentOpaque=False, root=0)
Parameters
occurrencesOccurrenceListOccurrences of components to process
cameraPositionsPoint3ListList of camera positions
cameraDirectionsPoint3ListList of camera directions
cameraUpsPoint3ListList of camera up vectors
resolutionIntResolution of the visibility viewer
fovXDoubleHorizontal field of view (in degree)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
rootOccurrenceSpecify another root for occluder scene
findOccludedPartOccurrences
get part occurrences viewed from a sphere around the scene
See also:
- algo.createVisibilityInformation
- algo.createVisibilityInformationAdvanced
- algo.createVisibilityInformationFromViewPoints
- algo.findOccludedPartOccurrencesAdvanced
- algo.removeOccludedGeometries
- algo.removeOccludedGeometriesAdvanced
- algo.removeOccludedGeometriesFromPoints
- algo.removeOccludedGeometriesFromViewPoints
algo.findOccludedPartOccurrences(occurrences, resolution, sphereCount, fovX, considerTransparentOpaque, root) -> scene.OccurrenceList
Parameters
occurrencesOccurrenceListOccurrences of components to process
resolutionIntResolution of the visibility viewer
sphereCountIntSegmentation of the sphere sphereCount x sphereCount
fovXDoubleHorizontal field of view (in degree)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
rootOccurrenceSpecify another root for occluder scene
Returns
- OccurrenceList
The list of occurrences meeting the criteria
findOccludedPartOccurrencesAdvanced
get part occurrences viewed from a set of voxel based view points.
See also:
- algo.createVisibilityInformation
- algo.createVisibilityInformationAdvanced
- algo.createVisibilityInformationFromViewPoints
- algo.findOccludedPartOccurrences
- algo.removeOccludedGeometries
- algo.removeOccludedGeometriesAdvanced
- algo.removeOccludedGeometriesFromPoints
- algo.removeOccludedGeometriesFromViewPoints
algo.findOccludedPartOccurrencesAdvanced(occurrences, voxelSize, minimumCavityVolume, resolution, mode, considerTransparentOpaque, root) -> scene.OccurrenceList
Parameters
occurrencesOccurrenceListOccurrences of components to process
voxelSizeDistanceSize of the voxels in mm (smaller it is, more viewpoints there are)
minimumCavityVolumeVolumeMinimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are)
resolutionIntResolution of the visibility viewer
modeInnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
rootOccurrenceSpecify another root for occluder scene
Returns
- OccurrenceList
The list of occurrences meeting the criteria
removeOccludedGeometries
Delete part occurrences, patches or polygons not viewed from a sphere around the scene
See also:
- algo.createVisibilityInformation
- algo.createVisibilityInformationAdvanced
- algo.createVisibilityInformationFromViewPoints
- algo.findOccludedPartOccurrences
- algo.findOccludedPartOccurrencesAdvanced
- algo.removeOccludedGeometriesAdvanced
- algo.removeOccludedGeometriesFromPoints
- algo.removeOccludedGeometriesFromViewPoints
algo.removeOccludedGeometries(occurrences, level, resolution, sphereCount, fovX, considerTransparentOpaque, adjacencyDepth, root) -> core.BoolList
Parameters
occurrencesOccurrenceListOccurrences of components to process
levelSelectionLevelLevel of geometries to remove : Parts, Patches or Polygons
resolutionIntResolution of the visibility viewer
sphereCountIntSegmentation of the sphere sphereCount x sphereCount
fovXDoubleHorizontal field of view (in degree)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
adjacencyDepthIntMark neighbors polygons as visible
rootOccurrenceSpecify another root for occluder scene
Returns
- BoolList
For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True)
removeOccludedGeometriesAdvanced
Delete part occurrences, patches or polygons not seen from voxel based view points.
See also:
- algo.createVisibilityInformation
- algo.createVisibilityInformationAdvanced
- algo.createVisibilityInformationFromViewPoints
- algo.findOccludedPartOccurrences
- algo.findOccludedPartOccurrencesAdvanced
- algo.removeOccludedGeometries
- algo.removeOccludedGeometriesFromPoints
- algo.removeOccludedGeometriesFromViewPoints
algo.removeOccludedGeometriesAdvanced(occurrences, level, voxelSize, minimumCavityVolume, resolution, mode, considerTransparentOpaque, adjacencyDepth, root) -> core.BoolList
Parameters
occurrencesOccurrenceListOccurrences of components to process
levelSelectionLevelLevel of geometries to remove : Parts, Patches or Polygons
voxelSizeDistanceSize of the voxels in mm (smaller it is, more viewpoints there are)
minimumCavityVolumeVolumeMinimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are)
resolutionIntResolution of the visibility viewer
modeInnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
adjacencyDepthIntMark neighbors polygons as visible
rootOccurrenceSpecify another root for occluder scene
Returns
- BoolList
For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True)
removeOccludedGeometriesFromPoints
Delete part occurrences, patches or polygons not viewed from spheres generated with a set of camera position
See also:
- algo.createVisibilityInformation
- algo.createVisibilityInformationAdvanced
- algo.createVisibilityInformationFromViewPoints
- algo.findOccludedPartOccurrences
- algo.findOccludedPartOccurrencesAdvanced
- algo.removeOccludedGeometries
- algo.removeOccludedGeometriesAdvanced
- algo.removeOccludedGeometriesFromViewPoints
algo.removeOccludedGeometriesFromPoints(occurrences, level, positions, resolution, sphereCount, fovX, considerTransparentOpaque, adjacencyDepth, root) -> core.BoolList
Parameters
occurrencesOccurrenceListOccurrences of components to process
levelSelectionLevelLevel of parts to remove : Parts, Patches or Polygons
positionsPoint3ListList of positions
resolutionIntResolution of the visibility viewer
sphereCountIntSegmentation of the sphere sphereCount x sphereCount
fovXDoubleHorizontal field of view (in degree)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
adjacencyDepthIntMark neighbors polygons as visible
rootOccurrenceSpecify another root for occluder scene
Returns
- BoolList
For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True)
removeOccludedGeometriesFromViewPoints
Delete part occurrences, patches or polygons not viewed from a set of camera position/orientation
See also:
- algo.createVisibilityInformation
- algo.createVisibilityInformationAdvanced
- algo.createVisibilityInformationFromViewPoints
- algo.findOccludedPartOccurrences
- algo.findOccludedPartOccurrencesAdvanced
- algo.removeOccludedGeometries
- algo.removeOccludedGeometriesAdvanced
- algo.removeOccludedGeometriesFromPoints
algo.removeOccludedGeometriesFromViewPoints(occurrences, level, positions, directions, ups, resolution, fovX, considerTransparentOpaque, adjacencyDepth, root) -> core.BoolList
Parameters
occurrencesOccurrenceListOccurrences of components to process
levelSelectionLevelLevel of geometries to remove : Parts, Patches or Polygons
positionsPoint3ListList of positions
directionsPoint3ListList of directions
upsPoint3ListList of up vectors
resolutionIntResolution of the visibility viewer
fovXDoubleHorizontal field of view (in degree)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
adjacencyDepthIntMark neighbors polygons as visible
rootOccurrenceSpecify another root for occluder scene
Returns
- BoolList
For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True)
createOcclusionMesh
Compute an occluder or an occludee with the occurrences selected
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.createOcclusionMesh(occurrences, type, voxelSize, gap) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
typeCreateOccluderType of what we create
voxelSizeDistanceSize of voxels
gapIntDilation iterations on the voxel grid
Returns
- Occurrence
Resulting part occurrence
dualContouring
Replace the tessellations of the selected parts by a retopology based on a dual-contouring
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.dualContouring(occurrences, minFixedDepth, maxDepth, tolerance, sameSizeOnAllAxis, aabb) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
minFixedDepthIntMinimum depth of the octree for removing inside parts
maxDepthIntMaximum depth of the octree for the dual-contouring (defines the minimum polygon size)
toleranceDoubleTolerance for the quadric error used for the simplification of the octree
sameSizeOnAllAxisBooleanIf true, use the maximum axis length of the AABB for all axis
aabbAABBAABB to use for the root of the octree
Returns
- Occurrence
Resulting part occurrence
dualContouringTarget
Replace the tessellations of the selected parts by a retopology based on a dual-contouring, controlled by a size in millimeter
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.dualContouringTarget(occurrences, filteringSize, voxelSize, tolerance, sameSizeOnAllAxis) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
filteringSizeDistanceFiltering size - must be a multiple of 2 of voxelSize
voxelSizeDistanceVoxel size used for the reconstruction
toleranceDoubleTolerance for the quadric error used for the simplification of the octree
sameSizeOnAllAxisBooleanIf true, use the maximum axis length of the AABB for all axis
Returns
- Occurrence
Resulting part occurrence
marchingCubes
Replace the tessellations of the selected parts by a marching cube representation
See also:
algo.marchingCubes(occurrences, voxelSize, elements, dilation, surfacic) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
voxelSizeDistanceSize of voxels
elementsElementFilterType of elements used to detect the voxels, polygons or points or hybrid
dilationIntDilation iterations on the voxel grid (only if surfacic=false)
surfacicBooleanPrefer this mode if the source is surfacic, the result is not guaranteed to be watertight
Returns
- Occurrence
Resulting part occurrence
proxyMesh
Replace the tessellations of the selected parts by a proxy mesh based on a voxelization
See also:
algo.proxyMesh(occurrences, voxelSize, elements, dilation, surfacic) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
voxelSizeDistanceSize of voxels
elementsElementFilterType of elements used to detect the voxels, polygons or points or hybrid
dilationIntDilation iterations on the voxel grid (only if surfacic=false)
surfacicBooleanPrefer this mode if the source is surfacic, the result is not guaranteed to be watertight
Returns
- Occurrence
Resulting part occurrence
retopologize
Replace the tessellations of the selected parts by a retopology of the external hull
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.retopologize(occurrences, targetTriangleCount, pureQuad, pointCloud, precision) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
targetTriangleCountIntTarget triangle count
pureQuadBoolRetopologize to a pure quad mesh if True, else the resulting mesh will be quad dominant but can contains triangles
pointCloudBoolSet to true if occurrences are point cloud, else False
precisionDistanceIf set, define the precision of the features to preserve
Returns
- Occurrence
Resulting part occurrence
voxelize
Replace the tessellations of the selected parts by a voxelization of the external skin
See also:
algo.voxelize(occurrences, voxelSize, elements, dilation, useCurrentAnimationPosition) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
voxelSizeDistanceSize of voxels
elementsElementFilterType of elements used to detect the voxels, polygons or points or hybrid
dilationIntDilation iterations on the voxel grid
useCurrentAnimationPositionBooleanUse the current animation position instead of the t-pose
Returns
- Occurrence
Resulting part occurrence
replaceBy
Replace geometries by other shapes, or primitives
See also:
algo.replaceBy(occurrences, replaceBy=["Occurrence", algo.ReplaceByOccurrenceOptions(0, False)])
Parameters
occurrencesOccurrenceListOccurrences of components to replace
replaceByReplaceByOptionShape replacement option
replaceByBox
Replace objects by a bounding box
See also:
algo.replaceByBox(occurrences, boxType)
Parameters
occurrencesOccurrenceListOccurrences of components to replace
boxTypeReplaceByBoxTypeBounding box type, oriented, axis-aligned, ...
replaceByConvexHull
Replace objects by convex hull
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.replaceByConvexHull(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to replace
replaceByPrimitive
Replace objects by a primitive shapes
See also:
algo.replaceByPrimitive(occurrences, primitive, generateUV=True)
Parameters
occurrencesOccurrenceListOccurrences of components to replace
primitivePrimitiveShapeParametersPrimitive type and parameters
generateUVBooleanPrimitive type and parameters
sawWithAABB
Saw the mesh with an axis-aligned bounding box. New parts will be placed as children of input part occurrences.
See also:
algo.sawWithAABB(occurrences, aabb, mode, innerSuffix="_inner", outerSuffix="_outer")
Parameters
occurrencesOccurrenceListPart occurrences to process
aabbAABBAxis-Aligned Bounding Box
modeSawingModeThe sawing mode
innerSuffixStringOnly if mode is set to SawAndSplit, set the suffix of the inner part
outerSuffixStringOnly if mode is set to SawAndSplit, set the suffix of the outer part
sawWithOBB
Saw the mesh with an oriented bounding box. New parts will be placed as children of input part occurrences.
See also:
algo.sawWithOBB(occurrences, obb, mode, innerSuffix="_inner", outerSuffix="_outer")
Parameters
occurrencesOccurrenceListPart occurrences to process
obbOBBMinimum Bounding Box
modeSawingModeThe sawing mode
innerSuffixStringOnly if mode is set to SawAndSplit, set the suffix of the inner part
outerSuffixStringOnly if mode is set to SawAndSplit, set the suffix of the outer part
sawWithOctree
Saw and split the mesh with an octree. New parts will be placed as children of input part occurrences.
See also:
algo.sawWithOctree(occurrences, aabb, maxDepth, maxTrianglesByLeaf, sawTolerance) -> scene.Occurrence
Parameters
occurrencesOccurrenceListPart occurrences to process
aabbAABBOctree Bounding Box
maxDepthIntDepth of the octree
maxTrianglesByLeafIntSet the maximum triangle count on the leaf of the octree ( -1 to not use )
sawToleranceDoubleSize in mm of the tolerance of the saw
Returns
- Occurrence
Root occurrence of the created octree
sawWithPlane
Saw the mesh with a plane. New parts will be placed as children of input part occurrences.
See also:
algo.sawWithPlane(occurrences, planeOrigin, planeNormal, mode, innerSuffix="_inner", outerSuffix="_outer", tolerance=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
planeOriginPoint3The plane origin
planeNormalVector3The plane normal
modeSawingModeThe sawing mode
innerSuffixStringOnly if mode is set to SawAndSplit, set the suffix of the inner part
outerSuffixStringOnly if mode is set to SawAndSplit, set the suffix of the outer part
toleranceDoubleSet a tolerance to make the saw lose
convertSimilarPartOccurrencesToInstances
Create instances from similar part occurrences with an accurate method based on topology checksums. This can be used to repair instances or to simplify a model that has similar parts that could be instantiated instead to reduce the number of unique meshes (reduces drawcalls, GPU memory usage and file size).
See also:
algo.convertSimilarPartOccurrencesToInstances(occurrences, checkMeshTopo=True, checkVertexPositions=True, vertexPositionPrecision=5, checkUVTopo=True, checkUVVertexPositions=True, UVPositionprecision=5, keepExistingPrototypes=False)
Parameters
occurrencesOccurrenceListOccurrence for which we want to find similar parts and create instances using prototypes.
checkMeshTopoBooleancheckVertexPositionsBooleanvertexPositionPrecisionIntcheckUVTopoBooleancheckUVVertexPositionsBooleanUVPositionprecisionIntkeepExistingPrototypesBoolean
convertSimilarPartOccurrencesToInstancesFast
Create instances from similar part occurrences with a fast but approximate method. This can be used to repair instances or to simplify a model that has similar parts that could be instantiated instead to reduce the number of unique meshes (reduces drawcalls, GPU memory usage and file size). Using 1.0 (100%) in all similarity criteria is non destructive. Using lower values will help finding more similar parts, even if their polycount or dimensions varies a bit.
See also:
algo.convertSimilarPartOccurrencesToInstancesFast(occurrences, dimensionsSimilarity=0.98, polycountSimilarity=0.98, ignoreSymmetry=False, keepExistingPrototypes=True, createNewOccurrencesForPrototypes=True)
Parameters
occurrencesOccurrenceListRoot occurrences for which we want to find similar part occurrences and create instances using prototypes.
dimensionsSimilarityCoeffThe percentage of similarity on dimensions. A value of 1.0 (100%) will find parts that have exactly the same dimensions. A lower value will increase the likelihood to find similar parts, at the cost of precision.
polycountSimilarityCoeffThe percentage of similarity on polycount. A value of 1.0 (100%) will find parts that have exactly the same polycount. A lower value will increase the likelihood to find similar parts, at the cost of precision.
ignoreSymmetryBooleanIf True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.
keepExistingPrototypesBooleanIf True, existing prototypes will be kept. Otherwise, the selection will be singularized and instanced will be created from scratch.
createNewOccurrencesForPrototypesBooleanIf True, a new occurrence will be created for each prototype. Those occurrences won't appear in the hierarchy, and so deleting one of the part in the scene has no risks of singularizing. If set to False, an arbitrary occurrence will be used as the prototype for other similar occurrences, which is less safe but will result in less occurrences.
findSimilarPartOccurrencesFast
find part occurrences in the whole scene that are similar to the input part occurrences. If multiple part occurrences are passed as input, the output will contain similar part occurrences corresponding to each input part occurrence.
See also:
algo.findSimilarPartOccurrencesFast(occurrences, dimensionsSimilarity, polycountSimilarity, ignoreSymmetry) -> scene.OccurrenceList
Parameters
occurrencesOccurrenceListOccurrences for which we want to find similar part occurrences in the scene.
dimensionsSimilarityCoeffThe percentage of similarity on dimensions. A value of 1.0 (100%) will find parts that have exactly the same dimensions. A lower value will increase the likelihood to find similar parts, at the cost of precision.
polycountSimilarityCoeffThe percentage of similarity on polycount. A value of 1.0 (100%) will find parts that have exactly the same polycount. A lower value will increase the likelihood to find similar parts, at the cost of precision.
ignoreSymmetryBooleanIf True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.
Returns
- OccurrenceList
The list of part occurrences meeting the criteria
alignUVIslands
Align with the axes the UVs of the islands
Warning
This function is tagged as EXPERIMENTAL.
See also:
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.alignUVIslands(occurrences, channel=0, usePolygonsWeights=0, useVerticesWeights=0, alignmentMode=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntUV channel to merge
usePolygonsWeightsDoubleUse polygons weights to give more importance to what must be aligned
useVerticesWeightsDoubleUse vertices weights to give more importance to what must be aligned
alignmentModeAlignmentModeWith which axis the UVs should be aligned
applyUvTransform
Apply a transformation matrix on texture coordinates
See also:
- algo.alignUVIslands
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.applyUvTransform(occurrences, matrix, channel=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
matrixMatrix4Transformationmatrix
channelIntUV channel to transform
automaticUVMapping
Generates the texture coordinates and automatically cut
Warning
This function is tagged as EXPERIMENTAL.
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.automaticUVMapping(occurrences, channel=0, maxAngleDistorsion=0.5, maxAreaDistorsion=-1, sharpToSeam=True, forbidOverlapping=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntThe UV channel which will contains the texture coordinates
maxAngleDistorsionDoubleMaximum angle distorsion |2PI-SumVtxAng|/2PI
maxAreaDistorsionDoubleMaximum area distorsion before scale to 1. |2DArea-3DArea|/3DArea
sharpToSeamBoolIf enabled, sharp edges are automatically considered as UV seams
forbidOverlappingBoolIf enabled, UV cannot overlap
copyUV
Copy an UV channel to another UV channel
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.copyUV(occurrences, sourceChannel=0, destinationChannel=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
sourceChannelIntThe source UV channel to copy
destinationChannelIntThe destination UV channel to copy into
defragmentUVIslands
Reduce the number of UV islands in a mesh parametrization by attempting to merge neighboring ones.
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.defragmentUVIslands(occurrences, channel=0, targetIslandCount=0, energyThreshold=0.01, forceIsolatedFaces=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntUV channel to use
targetIslandCountIntTarget number of islands (zero means the algorithm runs until no more merging is possible)
energyThresholdDoubleMax energy allowed during local reparametrization
forceIsolatedFacesBooleanUV islands consisting in a single isolated face completely surrounded by another island are forced to be merged, without reparametrization.
flattenUV
Flatten the UVs on the occurrence
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.flattenUV(occurrences, channel=0, iterations=1, newtonTolf=1.0, newtonTolx=1.0)
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntUV channel to merge
iterationsIntNumber of iterations to perform
newtonTolfDoubleThreshold for gradient normals
newtonTolxDoubleThreshold for gradient normals
getRatioUV3D
Compute the ratio between the UV and the 3D size
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.getRatioUV3D(occurrences, ratioMode, channel) -> core.DoubleList
Parameters
occurrencesOccurrenceListPart occurrences to process
ratioModeRatioUV3DModeChoose how to compute the ratio
channelIntUV channel to use
Returns
- DoubleList
Ratios 3Dsize/UVsize of the input occurrences
getUVQualityMetrics
Compute UV mapping qualitative metrics.
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.getUVQualityMetrics(occurrences, channel) -> core.UInt, core.Double, core.Double, core.Double, core.Double, core.Double
Parameters
occurrencesOccurrenceListPart occurrences to process
channelUIntUV channel to use
Returns
- UInt
Number of UV islands. If 0, all other returns are invalid.
getUvAabr
Compute the UV AABR of the selected occurrences
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.getUvAabr(occurrences, channel) -> geom.AABR
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntUV channel to transform
Returns
- AABR
The UV AABR
mapUvOnAABB
Generate texture coordinates using the projection on object Axis Aligned Bounding Box
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnAABB(occurrences, useLocalAABB=False, uv3dSize=100, channel=0, overrideExistingUVs=True, ignoreScale=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
useLocalAABBBoolIf enabled, uses part own bounding box, else use global one
uv3dSizeDistance3D size of the UV space [0-1]
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
ignoreScaleBooleanIf this and useLocalAABB are true, ignore local scale
mapUvOnBox
Generate texture coordinates using the projection on a box
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnBox(occurrences, box, channel=0, overrideExistingUVs=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
boxBoxBox definition
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
mapUvOnCubicAABB
Generate texture coordinates using the projection on object AABB, with same scale on each axis
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnCubicAABB(occurrences, uv3dSize=100, channel=0, overrideExistingUVs=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
uv3dSizeDistance3D size of the UV space [0-1]
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
mapUvOnCustomAABB
Generate texture coordinates using the projection on custom AABB
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnCustomAABB(occurrences, aabb, uv3dSize=100, channel=0, overrideExistingUVs=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
aabbAABBAxis aligned bounding box to project on
uv3dSizeDistance3D size of the UV space [0-1]
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
mapUvOnCylinder
Generate texture coordinates using the projection on a cylinder
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnCylinder(occurrences, cylinder, channel=0, overrideExistingUVs=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
cylinderCylinderCylinder definition
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
mapUvOnFittingCylinder
Generate texture coordinates using the projection on a fitting cylinder
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnFittingCylinder(occurrences, channel=0, overrideExistingUVs=True, useAABB=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
useAABBBooleanIf true use for the fitting the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB only based on transformed AABB of occurrences)
mapUvOnFittingSphere
Generate texture coordinates using the projection on a fitting sphere
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnFittingSphere(occurrences, channel=0, overrideExistingUVs=True, useAABB=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
useAABBBooleanIf true use for the fitting the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB only based on transformed AABB of occurrences)
mapUvOnMBB
Generate texture coordinates using the projection on object Minimum Bounding Box
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnMBB(occurrences, useLocalMBB=False, uv3dSize=100, channel=0, overrideExistingUVs=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
useLocalMBBBoolIf enabled, uses part own bounding box, else use global one
uv3dSizeDistance3D size of the UV space [0-1]
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
mapUvOnPlane
Generate texture coordinates using the projection on a plane
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnPlane(occurrences, plane, channel=0, overrideExistingUVs=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
planePlanePlane definition
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
mapUvOnSphere
Generate texture coordinates using the projection on a sphere
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mapUvOnSphere(occurrences, sphere, channel=0, overrideExistingUVs=True)
Parameters
occurrencesOccurrenceListPart occurrences to process
sphereSphereSphere definition
channelIntThe UV channel which will contains the texture coordinates
overrideExistingUVsBooleanIf True, override existing UVs on channel
mergeUVIslands
Minimizes the number of seams in the UV mapping
Warning
This function is tagged as EXPERIMENTAL.
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.mergeUVIslands(occurrences, channel=0, scaleWeights=0, maxScaleVariationFactor=1.2, curvatureWeights=-1, usePolygonsWeights=1, useVerticesWeights=-1, maxTransformationType=0, allowUVInversion=False)
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntUV channel to merge
scaleWeightsDoubleWeight to assign to scale for the merging priority
maxScaleVariationFactorDoubleMaximum scaling factor allowed, -1 meaning no limits
curvatureWeightsDoubleWeight to assign to curvature for the merging priority
usePolygonsWeightsDoubleUse polygons weights to prioritize seams between polygons with less weight. The value represents the feature weight
useVerticesWeightsDoubleUse vertices weights to prioritize seams where vertices with less weight. The value represents the feature weight
maxTransformationTypeMaxTransformationTypeMaximum transformation allowed: TRS only, affine and perspective
allowUVInversionBooleanAllow merged UVs to be inverted
normalizeUV
Normalize UVs to fit in the [0-1] uv space
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.normalizeUV(occurrences, sourceUVChannel=0, destinationUVChannel=-1, uniform=True, sharedUVSpace=True, ignoreNullIslands=False)
Parameters
occurrencesOccurrenceListPart occurrences to process
sourceUVChannelIntUV Channel to normalize
destinationUVChannelIntUV channel to store the normalized UV (if -1, sourceUVChannel will be replaced)
uniformBooleanIf true, the scale will be uniform. Else UV can be deformed with a non-uniform scale
sharedUVSpaceBooleanIf true, all parts will be processed as if they were merged to avoid overlapping of their UV coordinates
ignoreNullIslandsBooleanIf true, islands with null height and width will be ignored and their UV coordinates will be set to [0,0] (Slower if enabled)
relaxUV
Relax UVs
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.relaxUV(occurrences, method, iterations=100, channel=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
methodRelaxUVMethodWhat the method used to relax is based on
iterationsIntNumber of relax iterations
channelIntThe UV channel to repack
removeUV
Remove one or all UV channel(s)
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.removeUV(occurrences, channel=-1)
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntThe UV channel to remove (all if channel=-1)
repackUV
Pack existing UV (create atlas)
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.repackUV(occurrences, channel, shareMap, resolution, padding, uniformRatio, iterations, removeOverlaps) -> scene.OccurrenceList
Parameters
occurrencesOccurrenceListPart occurrences to process
channelIntThe UV channel to repack
shareMapBooleanIf True, the UV of all given parts will be packed together
resolutionIntResolution wanted for the final map
paddingUIntSet the padding (in pixels) between UV islands
uniformRatioBooleanIf true, UV of different part will have the same ratio
iterationsIntFitting iterations
removeOverlapsBooleanRemove overlaps to avoid multiple triangles UVs to share the same pixel
Returns
- OccurrenceList
Parts which failed to be repacked at this resolution (try to increase the resolution or decrease the padding)
resizeUVsToTextureSize
Rescale the UV coordinates to fit the input texture size
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.resizeUVsToTextureSize(occurrences, TextureSize=100, channel=0)
Parameters
occurrencesOccurrenceListOccurrences to use for the rescaling
TextureSizeDistanceTexture size to use for the UV coordinates (in millimeters)
channelIntUV channel to use
scaleUV
Apply a scale on texture coordinates
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.smoothUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.scaleUV(occurrences, scaleU, scaleV, channel=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
scaleUDoubleScale to apply to U coordinate
scaleVDoubleScale to apply to V coordinate
channelIntUV channel to transform
smoothUV
Smooth texture coordinates
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.swapUvChannels
- algo.transferVisibilityToPolygonalWeight
algo.smoothUV(occurrences, iterations=1, channel=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
iterationsIntNumber of smooth iterations
channelIntThe UV channel which will contains the texture coordinates to smooth
swapUvChannels
Swap two UV channels
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.transferVisibilityToPolygonalWeight
algo.swapUvChannels(occurrences, firstChannel=0, secondChannel=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
firstChannelIntFirst UV Channel to swap
secondChannelIntSecond UV Channel to swap
transferVisibilityToPolygonalWeight
Set Polygonal Weight Attribute from Visibility Attribute
Warning
This function is tagged as EXPERIMENTAL.
See also:
- algo.alignUVIslands
- algo.applyUvTransform
- algo.automaticUVMapping
- algo.copyUV
- algo.defragmentUVIslands
- algo.flattenUV
- algo.getRatioUV3D
- algo.getUVQualityMetrics
- algo.getUvAabr
- algo.mapUvOnAABB
- algo.mapUvOnBox
- algo.mapUvOnCubicAABB
- algo.mapUvOnCustomAABB
- algo.mapUvOnCylinder
- algo.mapUvOnFittingCylinder
- algo.mapUvOnFittingSphere
- algo.mapUvOnMBB
- algo.mapUvOnPlane
- algo.mapUvOnSphere
- algo.mergeUVIslands
- algo.normalizeUV
- algo.relaxUV
- algo.removeUV
- algo.repackUV
- algo.resizeUVsToTextureSize
- algo.scaleUV
- algo.smoothUV
- algo.swapUvChannels
algo.transferVisibilityToPolygonalWeight(occurrences, Mode=0)
Parameters
occurrencesOccurrenceListPart occurrences to process
ModeVisibilityToWeightModeMode used to compute visibility
getFittingCylinder
algo.getFittingCylinder(occurrences, useAABB) -> geom.Affine
Parameters
occurrencesOccurrenceListOccurrences to fit
useAABBBooleanIf true use the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box MBB only based on transformed AABB of occurrences)
Returns
- Affine
Affine transformation of the cylinder
getFittingSphere
algo.getFittingSphere(occurrences, useAABB) -> geom.Affine
Parameters
occurrencesOccurrenceListOccurrences to fit
useAABBBooleanIf true use the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB only based on transformed AABB of occurrences)
Returns
- Affine
Affine transformation of the sphere
bakeMaps
Bake texture maps on meshes from self or other meshes
See also:
algo.bakeMaps(destinationOccurrences, sourceOccurrences, mapsToBake, channel, resolution, padding, shareMaps, mapSuffix, additionalCustomMaps, tolerance, method, opacityThreshold, useCurrentPosition, offset, callbackList, oneToOne, reuseMaps, outputUsedMap) -> material.ImageList
Parameters
destinationOccurrencesOccurrenceListOccurrences of the meshes where to store the baked map
sourceOccurrencesOccurrenceListOccurrences of components from which to bake maps (if empty use destination)
mapsToBakeBakeMapListList of map to generate (Normal, Diffuse, ...)
channelIntUV channel of destOccurrence to use for the map generation
resolutionIntMap resolution
paddingIntAdd padding to the map. A negative value means that the texture will be filled, and the padding for uv island is the absolute value
shareMapsBooleanIf true, all the destinationOccurrences will share the same maps
mapSuffixStringAdd a suffix to the map names
additionalCustomMapsCustomBakeMapListAdditional custom maps to bake
toleranceDistanceTolerance of projection for baking from source to destination
methodBakingMethodMethod to find source color if source occurrences are different than destination occurrences (Prefer ProjOnly for point clouds and RayOnly for meshes)
opacityThresholdCoeffIf the opacity is under this threshold, considers as fully transparent and store the color behind the intersection
useCurrentPositionBooleanUse the current position instead of the T-Pose of the input occurrence
offsetDistanceOffset from mesh
callbackListgetPixelValueListCallbacks that returns a color
oneToOneBooleanIf true, each occurrence in sourceOccurrences will be baked to the occurrence in destinationOccurrences at the same index
reuseMapsImageListAllow to use existing image instead of creating new ones (override shareMaps=true) the maps must be in the same order than mapsToBake+additionalCustomMaps+callbackList + usedMap (see: outputUsedMap)
outputUsedMapBooleanIf True, an extra maps contained used pixels is output at the end of bakedMaps. It can be used by reuseMaps
Returns
- ImageList
Baked map list
convertNormalMap
Convert an existing normal map between Object-space and Tangent-space
See also:
algo.convertNormalMap(partOccurrences, normalMap, uvChannel, sourceIsObjectSpace, destinationIsObjectSpace, sourceIsRightHanded, destinationIsRightHanded, replaceMap, resolution, padding) -> material.Image
Parameters
partOccurrencesOccurrenceListOccurrences of components using the given map
normalMapImageSource normal map to convert
uvChannelIntUV channel used on the given map
sourceIsObjectSpaceBooleanIf True, consider the given normalMap in Object-space representation, else Tangent-space
destinationIsObjectSpaceBooleanIf True, convert the given normalMap to Object-space representation, else Tangent-space
sourceIsRightHandedBooleanConsiders source normal map as part of a right-handed coordinates system
destinationIsRightHandedBooleanGenerate destination normal map as part of a right-handed coordinates system
replaceMapBooleanIf true, the given normalMap will be replaced by the converted one
resolutionIntNew map resolution (if replaceMap=false), if resolution=-1, the input resolution will be used
paddingIntNumber of pixels to add for padding. A negative value means that the texture will be filled, and the padding for uv island is the absolute value
Returns
- Image
Converted normal map (equals normalMap if replaceMap=true)
createBillboard
Create a billboard imposter
See also:
algo.createBillboard(occurrences, resolution, XPositive, XNegative, YPositive, YNegative, ZPositive, ZNegative, moveFacesToCenter, leftHandedNormalMap) -> scene.Occurrence
Parameters
occurrencesOccurrenceListOccurrences to bake in the billboard
resolutionIntTotal resolution of the billboard (contains all wanted faces)
XPositiveBoolBake face facing X+
XNegativeBoolBake face facing X-
YPositiveBoolBake face facing Y+
YNegativeBoolBake face facing Y-
ZPositiveBoolBake face facing Z+
ZNegativeBoolBake face facing Z-
moveFacesToCenterBoolIf true, all face are moved to the center of the AABB of the occurrences, else it will shape an AABB
leftHandedNormalMapBoolIf true, a left handed normal map will be generated
Returns
- Occurrence
Resulting billboard
fillNormalMap
Fill normal map (useful after a decimation for example)
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.fillNormalMap(normalMap)
Parameters
normalMapImageSource normal map to convert
orientNormalMap
Orient a tangent space normal map (all Z positive)
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.orientNormalMap(normalMap)
Parameters
normalMapImageNormal map to orient
barySmooth
Smooth the tessellations by moving the vertices to the barycenter of their neighbors
See also:
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.barySmooth(occurrences, iteration=1)
Parameters
occurrencesOccurrenceListOccurrences of components to process
iterationIntNumber of iterations
crackMoebiusStrips
Remove moebius strip by topologically cracking them (make it orientable)
See also:
- algo.barySmooth
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.crackMoebiusStrips(occurrences, maxEdgeCount=3)
Parameters
occurrencesOccurrenceListOccurrences of components to repair
maxEdgeCountIntMaximum number of edges to crack to remove one moebius strip
crackNonManifoldVertices
Splits non-manifold vertices
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.crackNonManifoldVertices(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to repair
createCavityOccurrences
Identify cavities and create occurrences to show them
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.createCavityOccurrences(occurrences, voxelSize, minimumCavityVolume, mode, parent) -> scene.Occurrence
Parameters
occurrencesOccurrenceListOccurrences set to identify cavities
voxelSizeDistanceSize of the voxels in mm
minimumCavityVolumeVolumeMinimum volume of a cavity in cubic meter
modeInnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
parentOccurrenceThe create occurrence root will be added under the parent if given, else it will be added under the deeper parent of given occurrences
Returns
- Occurrence
Parent occurrence of the cavity occurrences
invertPolygonFacesOrientation
Invert the orientation of tessellation elements
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.invertPolygonFacesOrientation(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
moebiusCracker
Splits moebius ring
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.moebiusCracker(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to repair
orientNormals
Orient existing normal according to the polygons clockwise
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.orientNormals(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to orient normals
remeshSurfacicHoles
Resmesh surfacic holes of tessellations
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.remeshSurfacicHoles(occurrences, maxDiameter=0.1)
Parameters
occurrencesOccurrenceListOccurrences of components to process
maxDiameterDistanceMaximum surfacic holes diameters
removeDegeneratedPolygons
Remove some kinds of degenerated polygons
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.removeDegeneratedPolygons(occurrences, tolerance=0.1)
Parameters
occurrencesOccurrenceListOccurrences of components to process
toleranceDistanceDegenerated tolerance
removeMultiplePolygon
Remove multiple polygon
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.removeMultiplePolygon(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to repair
removeZFighting
Remove Z-fighting (surfaces overlapping) by slightly shrinking the selected parts' surfaces
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.removeZFighting(occurrences) -> geom.Distance
Parameters
occurrencesOccurrenceListOccurrences to process
Returns
- Distance
Offset value used by the algorithm
repairMesh
Launch the repair process to repair a disconnected or not clean tessellation
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.repairMesh(occurrences, tolerance=0.1, crackNonManifold=True, orient=True)
Parameters
occurrencesOccurrenceListOccurrences of components to process
toleranceDistanceConnection tolerance
crackNonManifoldBoolAt the end of the repair process, crack resulting non-manifold edges
orientBooleanIf true reorient the model
repairNullNormals
Create normal on an existing normal set when normal is null (polygons appears black)
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.separateToManifold
- algo.sewBoundary
- algo.vertexOffset
algo.repairNullNormals(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to repair null normals
separateToManifold
Remove non manifold edges and try to reconnect manifold groups of triangles
Warning
This function is tagged as EXPERIMENTAL.
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.sewBoundary
- algo.vertexOffset
algo.separateToManifold(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
sewBoundary
Sew boundaries between them
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.vertexOffset
algo.sewBoundary(occurrences, maxDistance)
Parameters
occurrencesOccurrenceListOccurrences of components to repair
maxDistanceDistanceMaximum distance between bundaries
vertexOffset
Move the vertices by the offsset along their normal
See also:
- algo.barySmooth
- algo.crackMoebiusStrips
- algo.crackNonManifoldVertices
- algo.createCavityOccurrences
- algo.invertPolygonFacesOrientation
- algo.moebiusCracker
- algo.orientNormals
- algo.remeshSurfacicHoles
- algo.removeDegeneratedPolygons
- algo.removeMultiplePolygon
- algo.removeZFighting
- algo.repairMesh
- algo.repairNullNormals
- algo.separateToManifold
- algo.sewBoundary
algo.vertexOffset(occurrences, offset=1)
Parameters
occurrencesOccurrenceListOccurrences to process
offsetDistanceDisplacement
orientFromFace
Orient all connected polygons in the same orientation of the polygon selectionned
See also:
algo.orientFromFace()
orientPolygonFaces
Orient tessellation elements
See also:
algo.orientPolygonFaces(occurrences, makeOrientable=True, useArea=False, orientStrategy=0)
Parameters
occurrencesOccurrenceListOccurrences of components to process
makeOrientableBooleanCrack moebius strips to make the model orientable
useAreaBooleanUse the area instead of counting the number of triangle
orientStrategyOrientStrategyStrategy to adopt with this algorithm
orientPolygonFacesAdvanced
Properly orient all polygons in the same direction, using voxel based view points placement.
See also:
algo.orientPolygonFacesAdvanced(occurrences, voxelSize=100, minimumCavityVolume=1, resolution=64, mode=0, considerTransparentOpaque=True, orientStrategy=0)
Parameters
occurrencesOccurrenceListOccurrences to orient
voxelSizeDistanceSize of the voxels in mm (smaller it is, more viewpoints there are)
minimumCavityVolumeVolumeMinimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are)
resolutionIntResolution of the visibility viewer
modeInnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
considerTransparentOpaqueBooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
orientStrategyOrientStrategyAdvancedStrategy to adopt with this algorithm
orientPolygonFacesFromCamera
Properly orient all polygons in the same direction, using a specified viewpoint
See also:
algo.orientPolygonFacesFromCamera(occurrences, cameraPosition, cameraDirection, cameraUp, resolution=1024, fovX=90)
Parameters
occurrencesOccurrenceListOccurrences to orient
cameraPositionPoint3Camera position
cameraDirectionPoint3Camera direction
cameraUpPoint3Camera up vector
resolutionIntResolution of the visibility viewer
fovXDoubleHorizontal field of view (in degree)
equilateralize
Sswap edges to make triangles more equilateral
See also:
algo.equilateralize(occurrences, maxIterations=1)
Parameters
occurrencesOccurrenceListOccurrences of components to process
maxIterationsIntMaximum number of swapping iteration
quadify
Merge all triangle polygons in the meshes to quadrangles
See also:
algo.quadify(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
requadify
Advanced function to requadify a triangle tessellation coming from full quad mesh
See also:
algo.requadify(occurrences, forceFullQuad=True)
Parameters
occurrencesOccurrenceListOccurrences of components to process
forceFullQuadBoolForce the results to be only full quad. It it's impossible, nothing is done
toEditableMesh
Convert all static mesh to editable mesh
See also:
algo.toEditableMesh(occurrences)
Parameters
occurrencesOccurrenceListOccurrences to convert to editable mesh
toStaticMesh
Convert all editable mesh to static mesh
See also:
algo.toStaticMesh(occurrences)
Parameters
occurrencesOccurrenceListOccurrences to convert to static mesh
triangularize
Split all non-triangle polygons in the meshes to triangles
See also:
algo.triangularize(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
createVertexWeightsFromVertexColors
Use vertex colors attributes on meshes of the given occurrence to create vertex weights attributes used by the decimation functions, the finals weights will be computed with w = offset + (red - blue) * scale
See also:
algo.createVertexWeightsFromVertexColors(occurrences, offset=0, scale=1)
Parameters
occurrencesOccurrenceListOccurrences of components to process
offsetDoubleOffset value for weight computation
scaleDoubleScale value for weight computation
createVertexWeightsFromVisibilityAttributes
Use visibility attributes on meshes of the given occurrence to create vertex weights attributes used by the decimation functions. The finals weights will be computed with w = offset + (visibility/maxVisibility) * scale
See also:
algo.createVertexWeightsFromVisibilityAttributes(occurrences, offset=0, scale=1)
Parameters
occurrencesOccurrenceListOccurrences of components to process
offsetDoubleOffset value for weight computation
scaleDoubleScale value for weight computation
deleteVertexWeights
Remove any existing vertex weights attributes on given occurrences
See also:
algo.deleteVertexWeights(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to process
createVisibilityAttributes
Create visibility attributes on tessellations
See also:
algo.createVisibilityAttributes(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to create attributes
deleteVisibilityAttributes
Delete visibility attributes on tessellations
See also:
algo.deleteVisibilityAttributes(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to delete attributes
flagVisibilityAttributesOnTransparents
Add one count to all visiblility attributes (poly and patch) on transparent patches
See also:
algo.flagVisibilityAttributesOnTransparents(occurrences)
Parameters
occurrencesOccurrenceListOccurrences of components to create attributes