Class Algo
- Namespace
Methods
assembleCAD
Assemble faces of CAD shapes
algo.assembleCAD(occurrences, tolerance=0.1, removeDuplicatedFaces=True)
Parameters
occurrences
OccurrenceListOccurrences of components to assemble
tolerance
DistanceAssembling tolerance
removeDuplicatedFaces
BooleanIf 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
occurrences
OccurrenceListOccurrences of components to process
bakeImpostor
bakes impostors textures
algo.bakeImpostor(occurrence, XFrames, YFrames, hemi, resolution, padding, roughness, metallic, ao) -> algo.OctahedralImpostor
Parameters
occurrence
OccurrenceXFrames
IntYFrames
Inthemi
Boolresolution
Intpadding
Introughness
Booleanmetallic
Booleanao
Boolean
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
destinationOccurrences
OccurrenceListOccurrences of the meshes where to store the baked vertex attributes
sourceOccurrences
OccurrenceListOccurrences of components from which to bake vertex attributes
skinnedMesh
BooleanEnabling skinned mesh baking (joint assignation for animation transfer)
positions
BooleanEnabling vertex position baking
useCurrentPositionAsTPose
BooleanUse 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
occurrences
OccurrenceListPart occurrences to process
combineMeshesByMaterials
Explode and (re)merge a set of mesh parts by visible materials
algo.combineMeshesByMaterials(occurrences, mergeNoMaterials, mergeHiddenPartsMode) -> scene.OccurrenceList
Parameters
occurrences
OccurrenceListOccurrences of the parts to merge
mergeNoMaterials
BooleanIf true, merge all parts with no active material together, else do not merge them
mergeHiddenPartsMode
MergeHiddenPartsModeHidden 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to process
useAttributesFilter
BooleanFilters by attribute
sharpAngleFilter
AngleSharp angle in degree to filter by edges sharpness, if the angle is negative do not filter
useNonManifoldFilter
BooleanFilters 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
occurrences
OccurrenceListOccurrences of components to process
normal
BooleanCrack on sharp normals
uvs
BooleanCrack on UV seams
uvChannels
IntListIf empty and uvs=true, crack all UV channel, else only channel specified in the list
loi
BooleanCrack on identifier Lines of Interests
patches
BooleanCrack on patch borders
nman
BooleanCrack on non-manifolds
createFreeEdgesFromPatches
Create free edges from patch borders
algo.createFreeEdgesFromPatches(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to process
createIdentifiedPatchesFromPatches
Create identified patch from existing patch (this is useful before cloning for baking)
algo.createIdentifiedPatchesFromPatches(occurrences)
Parameters
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListuvChannel
IntcreateTexture1D
BoolIf 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
occurrences
OccurrenceListOccurrences of components to create attributes
sharpEdge
AngleEdges with an angle between their polygons greater than sharpEdge will be considered sharp. If negative, smooth normals only.
override
BooleanIf true, override existing normals, else only create normals on meshes without normals
useAreaWeighting
BooleanIf 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
occurrences
OccurrenceListOccurrences to process
depth
IntKd tree depth
addToScene
BoolAdd 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
occurrences
OccurrenceListOccurrences of components to create attributes
uvChannel
IntUV channel to use for the tangents creation
override
BooleanIf 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
occurrenceList
OccurrenceList
createVisibilityPatchesFromPatch
Create visibility patches from existing patches
algo.createVisibilityPatchesFromPatch(occurrences)
Parameters
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to process
surfacicTolerance
DistanceMaximum distance between surfacic vertices and resulting simplified surfaces
lineicTolerance
DistanceMaximum distance between lineic vertices and resulting simplified lines
normalTolerance
AngleMaximum angle between original normals and those interpolated on the simplified surface
texCoordTolerance
DistanceMaximum distance (in 3D space) between original texcoords and those interpolated on the simplified surface
releaseConstraintOnSmallArea
BooleanIf 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
occurrences
OccurrenceListOccurrences of components to process
surfacicTolerance
DistanceError max between the simplified mesh et the old one
boundaryWeight
DoubleBoundary importance during the decimation
normalWeight
DoubleNormal importance during the decimation
UVWeight
DoubleUV importance during the decimation
sharpNormalWeight
DoubleImportance of sharp edges during the decimation
UVSeamWeight
DoubleImportance of UV seams during the decimation
normalMaxDeviation
AngleConstraint the normals deviation on decimated model
forbidUVOverlaps
BooleanForbid UV to fold over and overlap during the decimation
UVMaxDeviation
DoubleConstraint the uv deviation on decimated model
UVSeamMaxDeviation
DoubleConstraint the uv seams deviation on decimated model
protectTopology
BooleanIf 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
qualityTradeoff
QualitySpeedTradeoffFor 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
occurrences
OccurrenceListPart occurrences to process
tolerance
DistanceAvarage 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
occurrences
OccurrenceListList of occurrences to process
targetStrategy
DecimateOptionsSelectorSelect between targetCount or ratio to define the number of triangles left after the decimation process
UVImportance
UVImportanceEnumSelect importance of texture coordinates
protectTopology
BooleanIf False, the topology of the mesh can change and some edges can become non-manifold
iterativeThreshold
ULongNumber of triangles above which the iterative algorithm is used to limit the memory usage (disabled if processMeshIndependently=True)
processMeshIndependently
BooleanIf 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
occurrence
OccurrenceOccurrence to detele attribute from
type
AttributTypeAttribute type
deleteBRepShapes
Delete BRep representation on parts
algo.deleteBRepShapes(occurrences, onlyTessellated=True)
Parameters
occurrences
OccurrenceListOccurrences of components to process
onlyTessellated
BooleanIf 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
occurrences
OccurrenceListOccurrences of components to process
deleteLines
Delete all free line of the mesh of given parts
algo.deleteLines(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to process
deleteNormals
Remove normal attributes on tessellations
algo.deleteNormals(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to delete
deletePatches
Delete patches attributes on tessellations
algo.deletePatches(occurrences, keepOnePatchByMaterial=True)
Parameters
occurrences
OccurrenceListOccurrences of components to process
keepOnePatchByMaterial
BooleanIf 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
occurrences
OccurrenceListOccurrences of components to process
deleteTangents
Remove tangent attributes on tessellations
algo.deleteTangents(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to delete
deleteTextureCoordinates
Delete texture coordinates on tessellations
algo.deleteTextureCoordinates(occurrences, channel=-1)
Parameters
occurrences
OccurrenceListOccurrences of components to process
channel
IntChoose Texture coordinates channel to delete (-1 for all channels)
deleteVisibilityPatches
delete the visibility patches of given occurrences
algo.deleteVisibilityPatches(occurrences)
Parameters
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListList of occurrences to process
TargetStrategy
DecimateOptionsSelectorSelect between targetCount or ratio to define the number of triangles left after the decimation process
boundaryWeight
DoubleDefines how important the edges defining the mesh boundaries (free edges) are during the decimation process, to preserve them from distortion
normalWeight
DoubleDefines how important vertex normals are during the decimation process, to preserve the smoothing of the mesh from being damaged
UVWeight
DoubleDefines how important UVs (texture coordinates) are during the decimation process, to preserve them from being distorted (along with the textures using the UVs)
sharpNormalWeight
DoubleDefines how important sharp edges (or hard edges) are during the decimation process, to preserve them from being distorted
UVSeamWeight
DoubleDefines 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)
forbidUVFoldovers
BooleanForbids UVs to fold over and overlap each other during the decimation
protectTopology
BooleanIf 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
occurrences
OccurrenceListOccurrences of components to process
maxDiameter
DistanceMaximum diameter of beams
removeOriginalMesh
BooleanRemove 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
occurrences
OccurrenceListInput occurrences
value
DoubleValue (mm)
filletingMode
FilletingModeFilleting mode
subdivisionNb
IntNumber of subdivision
createFlatChamfer
BooleanIf there is 0 subdivision, should the fillet be a planar flat chamfer?
material
MaterialMaterial 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
occurrences
OccurrenceListPart occurrences to process
voxelSize
DistanceSize of voxels
getAllAxisFromCADModel
Return all the main axis contained in the CAD models given
algo.getAllAxisFromCADModel(occurrences) -> scene.OccurrenceList, geom.Matrix4ListList
Parameters
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences on which to compute optimal texture resolution
texelPerMm
DoubleNumber 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to process
useAttributesFilter
BooleanFilters by attributes
sharpAngleFilter
AngleSharp angle in degree to filter by edges sharpness, if the angle is negative do not filter
useBoundaryFilter
BooleanFilters by boundaries
useNonManifoldFilter
BooleanFilters by manifold-ness
useLineEdgeFilter
BooleanFilters by edge
useQuadLineFilter
BooleanFilters 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
occurrences
OccurrenceListInput occurrences
minSharpAngle
AngleThe angle between the normals - all edges sharpest than this will be filleted
maxSharpAngle
AngleAll edges sharpest than this won't be filleted
convexity
ConvexityFilterFillet sharp edges that are convex, concave or both
onlyExplicitSharp
BooleanIf 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
lines
OccurrenceListLines to select
useColor
UseColorOptionSet color policy.
resolution
IntTexture resolution
thickness
IntThe thickness of the lines in pixels
listFeatures
List features from tessellations
algo.listFeatures(occurrences, throughHoles, blindHoles, maxDiameter) -> algo.OccurrenceFeaturesList
Parameters
occurrences
OccurrenceListOccurrences of components to process
throughHoles
BooleanList through holes
blindHoles
BooleanList blind holes
maxDiameter
DistanceMaximum 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
occurrences
OccurrenceListOccurrences of components to process
depth
IntSubdivision depth
mergeVertices
merge near vertices according to the given distance
algo.mergeVertices(occurrences, maxDistance, mask)
Parameters
occurrences
OccurrenceListOccurrences of components to process
maxDistance
DistanceMaximum distance between two vertex to merge
mask
TopologyCategoryMaskTopological 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_1
Occurrencemesh_2
Occurrence
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
meshes1
OccurrenceListmeshes2
OccurrenceList
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
occurrence1
OccurrenceFirst Occurrence
occurrence2
OccurrenceSecond Occurrence
Returns
- Point3ListList
The intersections
noiseMesh
Apply noise to vertex positions along their normals
algo.noiseMesh(occurrences, maxAmplitude=1)
Parameters
occurrences
OccurrenceListPart occurrencess to noise
maxAmplitude
DistanceMaximum distance between original vertex and noisy vertex
optimizeCADLoops
Optimize CAD Face loops by merging useless loop edges
algo.optimizeCADLoops(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to optimize
optimizeForRendering
Optimize mesh for rendering (lossless, only reindexing)
algo.optimizeForRendering(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to optimize
optimizeSubMeshes
Sort sub meshes by materials
algo.optimizeSubMeshes(occurrences)
Parameters
occurrences
OccurrenceListPart 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
root
OccurrenceRoot from which texture resizing will process
texelPerMm
DoubleNumber 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
occurrences
OccurrenceListOccurrences of components to process
throughHoles
BooleanRemove through holes
blindHoles
BooleanRemove blind holes
surfacicHoles
BooleanRemove surfacic holes
maxDiameter
DistanceMaximum diameter of the holes to be removed (-1=no max diameter)
fillWithMaterial
MaterialIf 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
occurrences
OccurrenceListOccurrences of components to clean
tolerance
DistanceTolerance
orient
BooleanIf true reorient the model
setFeatureComponentMaxIndex
Remap Index map of each FeatureComponent of selected occurrences
algo.setFeatureComponentMaxIndex(occurrences, maxIndex)
Parameters
occurrences
OccurrenceListmaxIndex
Int
smoothMesh
algo.smoothMesh(occurrences, mode, maxIterations=100, lockSignificantEdges=True)
Parameters
occurrences
OccurrenceListOccurrences of components to process
mode
CostEvaluationComputation of cost
maxIterations
IntMaximum number of swapping iteration
lockSignificantEdges
BooleanForbid to swap significant edges (e.g. UV seams, sharp edges, patch borders, ...)
splitUVForAtlas
algo.splitUVForAtlas(occurrences)
Parameters
occurrences
OccurrenceListInput 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
occurrences
OccurrenceListOccurrences of components to check
radius
DistanceRadius of cylinders
sides
IntNumber of points to create cylinders
createNormals
BooleankeepLines
BooleangenerateUV
Boolean
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
occurrences
OccurrenceListOccurrences of components to tessellate
maxSag
DistanceMaximum distance between the geometry and the tessellation
maxLength
DistanceMaximum length of elements
maxAngle
AngleMaximum angle between normals of two adjacent elements
createNormals
BooleanIf true, normals will be generated
uvMode
UVGenerationModeSelect the texture coordinates generation mode
uvChannel
IntThe UV channel of the generated texture coordinates (if any)
uvPadding
DoubleThe 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
createTangents
BooleanIf true, tangents will be generated
createFreeEdges
BooleanIf true, free edges will be created for each patch borders
keepBRepShape
BooleanIf true, BRep shapes will be kept for Back to Brep or Retessellate
overrideExistingTessellation
BooleanIf 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
occurrences
OccurrenceListkNeighbors
IntThe number of neighbor points used to compute normals
keepPoints
BooleanKeep points after meshing if enabled
colorize
BooleanIf 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
occurrences
OccurrenceListOccurrences of components to tessellate
maxSag
DistanceMaximum distance between the geometry and the tessellation
sagRatio
DoubleMaximum ratio distance between the geometry and the tessellation
maxLength
DistanceMaximum length of elements
maxAngle
AngleMaximum angle between normals of two adjacent elements
createNormals
BooleanIf true, normals will be generated
uvMode
UVGenerationModeSelect the texture coordinates generation mode
uvChannel
IntThe UV channel of the generated texture coordinates (if any)
uvPadding
DoubleThe 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
createTangents
BooleanIf true, tangents will be generated
createFreeEdges
BooleanIf true, free edges will be created for each patch borders
keepBRepShape
BooleanIf true, BRep shapes will be kept for Back to Brep or Retessellate
overrideExistingTessellation
BooleanIf true, already tessellated parts will be re-tessellated
voxelizePointClouds
Explode point clouds to voxels
algo.voxelizePointClouds(occurrences, voxelSize=500)
Parameters
occurrences
OccurrenceListPart occurrences to process
voxelSize
DistanceSize of voxels
bakeUV
algo.bakeUV(source, destination, sourceChannel=0, destinationChannel=0, tolerance=0.001)
Parameters
source
OccurrenceOccurrence of the source mesh
destination
OccurrenceOccurrence of the destination mesh
sourceChannel
IntSource UV channel to bake
destinationChannel
IntDestination UV channel to bake to
tolerance
DistanceTolerance 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
occurrences
OccurrenceListPart occurrences to process
bakingOptions
BakeOptionBaking options
overrideExistingUVs
BooleanIf True, override existing UVs on channel
singularizeOnAO
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
bakingOptions
BakeOptionBaking options
overrideExistingUVs
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
maxCount
IntMaximum number of convex hull to generated
vertexCount
IntMaximum number of vertices per convex hull
approximate
BooleanApproximate method
resolution
IntResolution
concavity
DoubleConcavity
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
occurrences
OccurrenceListPart occurrences to process
groupOpenShells
BooleanGroup 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
occurrences
OccurrenceListPart 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
occurrences
OccurrenceListPart occurrences to process
maxVertexCount
IntThe maximum number of vertices by part
maxTriangleCount
IntThe maximum number of triangles by part (quadrangles count twice)
countMergedVerticesOnce
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
voxelSize
DistanceVoxel 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
occurrences
OccurrenceListPart occurrences to process
explodePatches
Explode all parts by patch
See also:
algo.explodePatches(occurrences)
Parameters
occurrences
OccurrenceListPart occurrences to process
legoDecomposition
Decompose a model in a set of lego bricks
algo.legoDecomposition(root, bricks, colors, density, forceFillingWithSmallBricks) -> algo.LegoReturn
Parameters
root
OccurrenceThe model root occurrence
bricks
LegoBrickDefinitionListcolors
ColorListdensity
IntforceFillingWithSmallBricks
Boolean
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
occurrences
OccurrenceListOccurrences of components to process
level
SelectionLevelLevel of geometries to remove : Parts, Patches or Polygons
resolution
IntResolution of the visibility viewer
sphereCount
IntSegmentation of the sphere sphereCount x sphereCount
fovX
DoubleHorizontal field of view (in degree)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
root
OccurrenceSpecify 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
occurrences
OccurrenceListOccurrences of components to process
voxelSize
DistanceSize of the voxels in mm (smaller it is, more viewpoints there are)
minimumCavityVolume
VolumeMinimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are)
resolution
IntResolution of the visibility viewer
mode
InnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
root
OccurrenceSpecify 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
occurrences
OccurrenceListOccurrences of components to process
cameraPositions
Point3ListList of camera positions
cameraDirections
Point3ListList of camera directions
cameraUps
Point3ListList of camera up vectors
resolution
IntResolution of the visibility viewer
fovX
DoubleHorizontal field of view (in degree)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
root
OccurrenceSpecify 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
occurrences
OccurrenceListOccurrences of components to process
resolution
IntResolution of the visibility viewer
sphereCount
IntSegmentation of the sphere sphereCount x sphereCount
fovX
DoubleHorizontal field of view (in degree)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
root
OccurrenceSpecify 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
occurrences
OccurrenceListOccurrences of components to process
voxelSize
DistanceSize of the voxels in mm (smaller it is, more viewpoints there are)
minimumCavityVolume
VolumeMinimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are)
resolution
IntResolution of the visibility viewer
mode
InnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
root
OccurrenceSpecify 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
occurrences
OccurrenceListOccurrences of components to process
level
SelectionLevelLevel of geometries to remove : Parts, Patches or Polygons
resolution
IntResolution of the visibility viewer
sphereCount
IntSegmentation of the sphere sphereCount x sphereCount
fovX
DoubleHorizontal field of view (in degree)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
adjacencyDepth
IntMark neighbors polygons as visible
root
OccurrenceSpecify 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
occurrences
OccurrenceListOccurrences of components to process
level
SelectionLevelLevel of geometries to remove : Parts, Patches or Polygons
voxelSize
DistanceSize of the voxels in mm (smaller it is, more viewpoints there are)
minimumCavityVolume
VolumeMinimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are)
resolution
IntResolution of the visibility viewer
mode
InnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
adjacencyDepth
IntMark neighbors polygons as visible
root
OccurrenceSpecify 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
occurrences
OccurrenceListOccurrences of components to process
level
SelectionLevelLevel of parts to remove : Parts, Patches or Polygons
positions
Point3ListList of positions
resolution
IntResolution of the visibility viewer
sphereCount
IntSegmentation of the sphere sphereCount x sphereCount
fovX
DoubleHorizontal field of view (in degree)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
adjacencyDepth
IntMark neighbors polygons as visible
root
OccurrenceSpecify 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
occurrences
OccurrenceListOccurrences of components to process
level
SelectionLevelLevel of geometries to remove : Parts, Patches or Polygons
positions
Point3ListList of positions
directions
Point3ListList of directions
ups
Point3ListList of up vectors
resolution
IntResolution of the visibility viewer
fovX
DoubleHorizontal field of view (in degree)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
adjacencyDepth
IntMark neighbors polygons as visible
root
OccurrenceSpecify 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
occurrences
OccurrenceListPart occurrences to process
type
CreateOccluderType of what we create
voxelSize
DistanceSize of voxels
gap
IntDilation 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
occurrences
OccurrenceListPart occurrences to process
minFixedDepth
IntMinimum depth of the octree for removing inside parts
maxDepth
IntMaximum depth of the octree for the dual-contouring (defines the minimum polygon size)
tolerance
DoubleTolerance for the quadric error used for the simplification of the octree
sameSizeOnAllAxis
BooleanIf true, use the maximum axis length of the AABB for all axis
aabb
AABBAABB 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
occurrences
OccurrenceListPart occurrences to process
filteringSize
DistanceFiltering size - must be a multiple of 2 of voxelSize
voxelSize
DistanceVoxel size used for the reconstruction
tolerance
DoubleTolerance for the quadric error used for the simplification of the octree
sameSizeOnAllAxis
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
voxelSize
DistanceSize of voxels
elements
ElementFilterType of elements used to detect the voxels, polygons or points or hybrid
dilation
IntDilation iterations on the voxel grid (only if surfacic=false)
surfacic
BooleanPrefer 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
occurrences
OccurrenceListPart occurrences to process
voxelSize
DistanceSize of voxels
elements
ElementFilterType of elements used to detect the voxels, polygons or points or hybrid
dilation
IntDilation iterations on the voxel grid (only if surfacic=false)
surfacic
BooleanPrefer 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
occurrences
OccurrenceListPart occurrences to process
targetTriangleCount
IntTarget triangle count
pureQuad
BoolRetopologize to a pure quad mesh if True, else the resulting mesh will be quad dominant but can contains triangles
pointCloud
BoolSet to true if occurrences are point cloud, else False
precision
DistanceIf 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
occurrences
OccurrenceListPart occurrences to process
voxelSize
DistanceSize of voxels
elements
ElementFilterType of elements used to detect the voxels, polygons or points or hybrid
dilation
IntDilation iterations on the voxel grid
useCurrentAnimationPosition
BooleanUse 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
occurrences
OccurrenceListOccurrences of components to replace
replaceBy
ReplaceByOptionShape replacement option
replaceByBox
Replace objects by a bounding box
See also:
algo.replaceByBox(occurrences, boxType)
Parameters
occurrences
OccurrenceListOccurrences of components to replace
boxType
ReplaceByBoxTypeBounding box type, oriented, axis-aligned, ...
replaceByConvexHull
Replace objects by convex hull
Warning
This function is tagged as EXPERIMENTAL.
See also:
algo.replaceByConvexHull(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to replace
replaceByPrimitive
Replace objects by a primitive shapes
See also:
algo.replaceByPrimitive(occurrences, primitive, generateUV=True)
Parameters
occurrences
OccurrenceListOccurrences of components to replace
primitive
PrimitiveShapeParametersPrimitive type and parameters
generateUV
BooleanPrimitive 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
occurrences
OccurrenceListPart occurrences to process
aabb
AABBAxis-Aligned Bounding Box
mode
SawingModeThe sawing mode
innerSuffix
StringOnly if mode is set to SawAndSplit, set the suffix of the inner part
outerSuffix
StringOnly 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
occurrences
OccurrenceListPart occurrences to process
obb
OBBMinimum Bounding Box
mode
SawingModeThe sawing mode
innerSuffix
StringOnly if mode is set to SawAndSplit, set the suffix of the inner part
outerSuffix
StringOnly 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
occurrences
OccurrenceListPart occurrences to process
aabb
AABBOctree Bounding Box
maxDepth
IntDepth of the octree
maxTrianglesByLeaf
IntSet the maximum triangle count on the leaf of the octree ( -1 to not use )
sawTolerance
DoubleSize 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
occurrences
OccurrenceListPart occurrences to process
planeOrigin
Point3The plane origin
planeNormal
Vector3The plane normal
mode
SawingModeThe sawing mode
innerSuffix
StringOnly if mode is set to SawAndSplit, set the suffix of the inner part
outerSuffix
StringOnly if mode is set to SawAndSplit, set the suffix of the outer part
tolerance
DoubleSet 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
occurrences
OccurrenceListOccurrence for which we want to find similar parts and create instances using prototypes.
checkMeshTopo
BooleancheckVertexPositions
BooleanvertexPositionPrecision
IntcheckUVTopo
BooleancheckUVVertexPositions
BooleanUVPositionprecision
IntkeepExistingPrototypes
Boolean
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
occurrences
OccurrenceListRoot occurrences for which we want to find similar part occurrences and create instances using prototypes.
dimensionsSimilarity
CoeffThe 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.
polycountSimilarity
CoeffThe 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.
ignoreSymmetry
BooleanIf True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.
keepExistingPrototypes
BooleanIf True, existing prototypes will be kept. Otherwise, the selection will be singularized and instanced will be created from scratch.
createNewOccurrencesForPrototypes
BooleanIf 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
occurrences
OccurrenceListOccurrences for which we want to find similar part occurrences in the scene.
dimensionsSimilarity
CoeffThe 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.
polycountSimilarity
CoeffThe 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.
ignoreSymmetry
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
channel
IntUV channel to merge
usePolygonsWeights
DoubleUse polygons weights to give more importance to what must be aligned
useVerticesWeights
DoubleUse vertices weights to give more importance to what must be aligned
alignmentMode
AlignmentModeWith 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
occurrences
OccurrenceListPart occurrences to process
matrix
Matrix4Transformationmatrix
channel
IntUV 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
occurrences
OccurrenceListPart occurrences to process
channel
IntThe UV channel which will contains the texture coordinates
maxAngleDistorsion
DoubleMaximum angle distorsion |2PI-SumVtxAng|/2PI
maxAreaDistorsion
DoubleMaximum area distorsion before scale to 1. |2DArea-3DArea|/3DArea
sharpToSeam
BoolIf enabled, sharp edges are automatically considered as UV seams
forbidOverlapping
BoolIf 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
occurrences
OccurrenceListPart occurrences to process
sourceChannel
IntThe source UV channel to copy
destinationChannel
IntThe 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
occurrences
OccurrenceListPart occurrences to process
channel
IntUV channel to use
targetIslandCount
IntTarget number of islands (zero means the algorithm runs until no more merging is possible)
energyThreshold
DoubleMax energy allowed during local reparametrization
forceIsolatedFaces
BooleanUV 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
occurrences
OccurrenceListPart occurrences to process
channel
IntUV channel to merge
iterations
IntNumber of iterations to perform
newtonTolf
DoubleThreshold for gradient normals
newtonTolx
DoubleThreshold 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
occurrences
OccurrenceListPart occurrences to process
ratioMode
RatioUV3DModeChoose how to compute the ratio
channel
IntUV 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
occurrences
OccurrenceListPart occurrences to process
channel
UIntUV 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
occurrences
OccurrenceListPart occurrences to process
channel
IntUV 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
occurrences
OccurrenceListPart occurrences to process
useLocalAABB
BoolIf enabled, uses part own bounding box, else use global one
uv3dSize
Distance3D size of the UV space [0-1]
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf True, override existing UVs on channel
ignoreScale
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
box
BoxBox definition
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
uv3dSize
Distance3D size of the UV space [0-1]
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
aabb
AABBAxis aligned bounding box to project on
uv3dSize
Distance3D size of the UV space [0-1]
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
cylinder
CylinderCylinder definition
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf True, override existing UVs on channel
useAABB
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf True, override existing UVs on channel
useAABB
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
useLocalMBB
BoolIf enabled, uses part own bounding box, else use global one
uv3dSize
Distance3D size of the UV space [0-1]
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
plane
PlanePlane definition
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
sphere
SphereSphere definition
channel
IntThe UV channel which will contains the texture coordinates
overrideExistingUVs
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
channel
IntUV channel to merge
scaleWeights
DoubleWeight to assign to scale for the merging priority
maxScaleVariationFactor
DoubleMaximum scaling factor allowed, -1 meaning no limits
curvatureWeights
DoubleWeight to assign to curvature for the merging priority
usePolygonsWeights
DoubleUse polygons weights to prioritize seams between polygons with less weight. The value represents the feature weight
useVerticesWeights
DoubleUse vertices weights to prioritize seams where vertices with less weight. The value represents the feature weight
maxTransformationType
MaxTransformationTypeMaximum transformation allowed: TRS only, affine and perspective
allowUVInversion
BooleanAllow 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
occurrences
OccurrenceListPart occurrences to process
sourceUVChannel
IntUV Channel to normalize
destinationUVChannel
IntUV channel to store the normalized UV (if -1, sourceUVChannel will be replaced)
uniform
BooleanIf true, the scale will be uniform. Else UV can be deformed with a non-uniform scale
sharedUVSpace
BooleanIf true, all parts will be processed as if they were merged to avoid overlapping of their UV coordinates
ignoreNullIslands
BooleanIf 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
occurrences
OccurrenceListPart occurrences to process
method
RelaxUVMethodWhat the method used to relax is based on
iterations
IntNumber of relax iterations
channel
IntThe 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
occurrences
OccurrenceListPart occurrences to process
channel
IntThe 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
occurrences
OccurrenceListPart occurrences to process
channel
IntThe UV channel to repack
shareMap
BooleanIf True, the UV of all given parts will be packed together
resolution
IntResolution wanted for the final map
padding
UIntSet the padding (in pixels) between UV islands
uniformRatio
BooleanIf true, UV of different part will have the same ratio
iterations
IntFitting iterations
removeOverlaps
BooleanRemove 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
occurrences
OccurrenceListOccurrences to use for the rescaling
TextureSize
DistanceTexture size to use for the UV coordinates (in millimeters)
channel
IntUV 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
occurrences
OccurrenceListPart occurrences to process
scaleU
DoubleScale to apply to U coordinate
scaleV
DoubleScale to apply to V coordinate
channel
IntUV 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
occurrences
OccurrenceListPart occurrences to process
iterations
IntNumber of smooth iterations
channel
IntThe 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
occurrences
OccurrenceListPart occurrences to process
firstChannel
IntFirst UV Channel to swap
secondChannel
IntSecond 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
occurrences
OccurrenceListPart occurrences to process
Mode
VisibilityToWeightModeMode used to compute visibility
getFittingCylinder
algo.getFittingCylinder(occurrences, useAABB) -> geom.Affine
Parameters
occurrences
OccurrenceListOccurrences to fit
useAABB
BooleanIf 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
occurrences
OccurrenceListOccurrences to fit
useAABB
BooleanIf 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
destinationOccurrences
OccurrenceListOccurrences of the meshes where to store the baked map
sourceOccurrences
OccurrenceListOccurrences of components from which to bake maps (if empty use destination)
mapsToBake
BakeMapListList of map to generate (Normal, Diffuse, ...)
channel
IntUV channel of destOccurrence to use for the map generation
resolution
IntMap resolution
padding
IntAdd padding to the map. A negative value means that the texture will be filled, and the padding for uv island is the absolute value
shareMaps
BooleanIf true, all the destinationOccurrences will share the same maps
mapSuffix
StringAdd a suffix to the map names
additionalCustomMaps
CustomBakeMapListAdditional custom maps to bake
tolerance
DistanceTolerance of projection for baking from source to destination
method
BakingMethodMethod to find source color if source occurrences are different than destination occurrences (Prefer ProjOnly for point clouds and RayOnly for meshes)
opacityThreshold
CoeffIf the opacity is under this threshold, considers as fully transparent and store the color behind the intersection
useCurrentPosition
BooleanUse the current position instead of the T-Pose of the input occurrence
offset
DistanceOffset from mesh
callbackList
getPixelValueListCallbacks that returns a color
oneToOne
BooleanIf true, each occurrence in sourceOccurrences will be baked to the occurrence in destinationOccurrences at the same index
reuseMaps
ImageListAllow 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)
outputUsedMap
BooleanIf 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
partOccurrences
OccurrenceListOccurrences of components using the given map
normalMap
ImageSource normal map to convert
uvChannel
IntUV channel used on the given map
sourceIsObjectSpace
BooleanIf True, consider the given normalMap in Object-space representation, else Tangent-space
destinationIsObjectSpace
BooleanIf True, convert the given normalMap to Object-space representation, else Tangent-space
sourceIsRightHanded
BooleanConsiders source normal map as part of a right-handed coordinates system
destinationIsRightHanded
BooleanGenerate destination normal map as part of a right-handed coordinates system
replaceMap
BooleanIf true, the given normalMap will be replaced by the converted one
resolution
IntNew map resolution (if replaceMap=false), if resolution=-1, the input resolution will be used
padding
IntNumber 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
occurrences
OccurrenceListOccurrences to bake in the billboard
resolution
IntTotal resolution of the billboard (contains all wanted faces)
XPositive
BoolBake face facing X+
XNegative
BoolBake face facing X-
YPositive
BoolBake face facing Y+
YNegative
BoolBake face facing Y-
ZPositive
BoolBake face facing Z+
ZNegative
BoolBake face facing Z-
moveFacesToCenter
BoolIf true, all face are moved to the center of the AABB of the occurrences, else it will shape an AABB
leftHandedNormalMap
BoolIf 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
normalMap
ImageSource 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
normalMap
ImageNormal 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
occurrences
OccurrenceListOccurrences of components to process
iteration
IntNumber 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
occurrences
OccurrenceListOccurrences of components to repair
maxEdgeCount
IntMaximum 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences set to identify cavities
voxelSize
DistanceSize of the voxels in mm
minimumCavityVolume
VolumeMinimum volume of a cavity in cubic meter
mode
InnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
parent
OccurrenceThe 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to process
maxDiameter
DistanceMaximum 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
occurrences
OccurrenceListOccurrences of components to process
tolerance
DistanceDegenerated 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to process
tolerance
DistanceConnection tolerance
crackNonManifold
BoolAt the end of the repair process, crack resulting non-manifold edges
orient
BooleanIf 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to repair
maxDistance
DistanceMaximum 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
occurrences
OccurrenceListOccurrences to process
offset
DistanceDisplacement
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
occurrences
OccurrenceListOccurrences of components to process
makeOrientable
BooleanCrack moebius strips to make the model orientable
useArea
BooleanUse the area instead of counting the number of triangle
orientStrategy
OrientStrategyStrategy 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
occurrences
OccurrenceListOccurrences to orient
voxelSize
DistanceSize of the voxels in mm (smaller it is, more viewpoints there are)
minimumCavityVolume
VolumeMinimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are)
resolution
IntResolution of the visibility viewer
mode
InnerOuterOptionSelect where to place camera (all cavities, only outer or only inner cavities)
considerTransparentOpaque
BooleanIf True, Parts, Patches or Polygons with a transparent appearance are considered as opaque
orientStrategy
OrientStrategyAdvancedStrategy 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
occurrences
OccurrenceListOccurrences to orient
cameraPosition
Point3Camera position
cameraDirection
Point3Camera direction
cameraUp
Point3Camera up vector
resolution
IntResolution of the visibility viewer
fovX
DoubleHorizontal field of view (in degree)
equilateralize
Sswap edges to make triangles more equilateral
See also:
algo.equilateralize(occurrences, maxIterations=1)
Parameters
occurrences
OccurrenceListOccurrences of components to process
maxIterations
IntMaximum number of swapping iteration
quadify
Merge all triangle polygons in the meshes to quadrangles
See also:
algo.quadify(occurrences)
Parameters
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to process
forceFullQuad
BoolForce 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
occurrences
OccurrenceListOccurrences to convert to editable mesh
toStaticMesh
Convert all editable mesh to static mesh
See also:
algo.toStaticMesh(occurrences)
Parameters
occurrences
OccurrenceListOccurrences to convert to static mesh
triangularize
Split all non-triangle polygons in the meshes to triangles
See also:
algo.triangularize(occurrences)
Parameters
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to process
offset
DoubleOffset value for weight computation
scale
DoubleScale 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
occurrences
OccurrenceListOccurrences of components to process
offset
DoubleOffset value for weight computation
scale
DoubleScale value for weight computation
deleteVertexWeights
Remove any existing vertex weights attributes on given occurrences
See also:
algo.deleteVertexWeights(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to process
createVisibilityAttributes
Create visibility attributes on tessellations
See also:
algo.createVisibilityAttributes(occurrences)
Parameters
occurrences
OccurrenceListOccurrences of components to create attributes
deleteVisibilityAttributes
Delete visibility attributes on tessellations
See also:
algo.deleteVisibilityAttributes(occurrences)
Parameters
occurrences
OccurrenceListOccurrences 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
occurrences
OccurrenceListOccurrences of components to create attributes