Asset Transformer SDK (ex Pixyz) Algo Python API functions
Read time 96 minutes
Last updated 21 hours ago assembleCAD
Assemble faces of CAD shapes.
algo.assembleCAD(occurrences, tolerance=0.1, removeDuplicatedFaces=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to assemble. Distance tolerance Assembling tolerance. Boolean removeDuplicatedFaces If 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
Type Name Description OccurrenceList occurrences Occurrences of components to process.
bakeImpostor
Bakes impostors textures.
algo.bakeImpostor(occurrence, XFrames, YFrames, hemi=False, resolution=1024, padding=0, roughness=False, metallic=False, ao=False) -> algo.OctahedralImpostor
Parameters
Returns
bakeVertexAttributes
Bake vertex attributes on meshes from other meshes.
algo.bakeVertexAttributes(destinationOccurrences, sourceOccurrences=[], skinnedMesh=True, positions=False, useCurrentPositionAsTPose=False)
Parameters
Type Name Description OccurrenceList destinationOccurrences Occurrences of the meshes where to store the baked vertex attributes. OccurrenceList sourceOccurrences Occurrences of components from which to bake vertex attributes. Boolean skinnedMesh Enabling skinned mesh baking (joint assignation for animation transfer). Boolean positions Enabling vertex position baking. Boolean useCurrentPositionAsTPose Use the current position as the T-Pose.
calculateNormalsInPointClouds
Important
This function is tagged as experimental.
Calculate the normal of each point of a Point Cloud.
algo.calculateNormalsInPointClouds(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process.
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
Type Name Description OccurrenceList occurrences Occurrences of components to check.
crackEdges
Warning
This function is deprecated.
Crack polygonal edges according to given criteria (deprecated, use crackMeshEdges instead).
algo.crackEdges(occurrences, useAttributesFilter=True, sharpAngleFilter=45, useNonManifoldFilter=False)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean useAttributesFilter Filters by attribute. Angle sharpAngleFilter Sharp angle in degree to filter by edges sharpness, if the angle is negative do not filter. Boolean useNonManifoldFilter Filters by manifold-ness.
crackMeshEdges
Crack polygonal edges according to given criteria.
algo.crackMeshEdges(occurrences, normal=False, uvs=False, uvChannels=None, loi=False, patches=False, nman=False)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean normal Crack on sharp normals. Boolean uvs Crack on UV seams. IntList uvChannels If empty and uvs=true, crack all UV channel, else only channel specified in the list. Boolean loi Crack on identifier Lines of Interests. Boolean patches Crack on patch borders. Boolean nman Crack on non-manifolds.
createFreeEdgesFromPatches
Create free edges from patch borders.
algo.createFreeEdgesFromPatches(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
createIdentifiedPatchesFromPatches
Create identified patch from existing patch (this is useful before cloning for baking).
algo.createIdentifiedPatchesFromPatches(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences 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=1, createTexture1D=False) -> material.Image
Parameters
Type Name Description OccurrenceList occurrences Int uvChannel Bool createTexture1D If 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
Type Name Description Image indexMap
createNormals
Create normal attributes on tessellations.
algo.createNormals(occurrences, sharpEdge=45, override=True, useAreaWeighting=False)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to create attributes. Angle sharpEdge Edges with an angle between their polygons greater than sharpEdge will be considered sharp. If negative, smooth normals only. Boolean override If true, override existing normals, else only create normals on meshes without normals. Boolean useAreaWeighting If 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=True) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Occurrences to process. Int depth Kd tree depth. Bool addToScene Add the KD-Tree to the current scene.
Returns
Type Name Description Occurrence root KD-Tree root occurrence.
createTangents
Create tangent attributes on tessellations.
algo.createTangents(occurrences, uvChannel=0, override=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to create attributes. Int uvChannel UV channel to use for the tangents creation. Boolean override If 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
createVisibilityPatchesFromPatch
Create visibility patches from existing patches.
algo.createVisibilityPatchesFromPatch(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences 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
Type Name Description OccurrenceList occurrences Occurrences of components to process. Distance surfacicTolerance Maximum distance between surfacic vertices and resulting simplified surfaces. Distance lineicTolerance Maximum distance between lineic vertices and resulting simplified lines. Angle normalTolerance Maximum angle between original normals and those interpolated on the simplified surface. Distance texCoordTolerance Maximum distance (in 3D space) between original texcoords and those interpolated on the simplified surface. Boolean releaseConstraintOnSmallArea If True, release constraint of normal and/or texcoord tolerance on small areas (according to surfacicTolerance).
decimateEdgeCollapse
Important
This function is tagged as experimental.
Reduce the polygon count by collapsing some edges to obtain an simplified mesh.
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
Type Name Description OccurrenceList occurrences Occurrences of components to process. Distance surfacicTolerance Error max between the simplified mesh et the old one. Double boundaryWeight Boundary importance during the decimation. Double normalWeight Normal importance during the decimation. Double UVWeight UV importance during the decimation. Double sharpNormalWeight Importance of sharp edges during the decimation. Double UVSeamWeight Importance of UV seams during the decimation. Angle normalMaxDeviation Constraint the normals deviation on decimated model. Boolean forbidUVOverlaps Forbid UV to fold over and overlap during the decimation. Double UVMaxDeviation Constraint the uv deviation on decimated model. Double UVSeamMaxDeviation Constraint the uv seams deviation on decimated model. Boolean protectTopology If 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. QualitySpeedTradeoff qualityTradeoff For 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
Type Name Description OccurrenceList occurrences Part occurrences to process. Distance tolerance Avarage 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, maxQuadricAge=-1)
Parameters
Type Name Description OccurrenceList occurrences List of occurrences to process. DecimateOptionsSelector targetStrategy Select between targetCount or ratio to define the number of triangles left after the decimation process. UVImportanceEnum UVImportance Select importance of texture coordinates. Boolean protectTopology If False, the topology of the mesh can change and some edges can become non-manifold. ULong iterativeThreshold Number of triangles above which the iterative algorithm is used to limit the memory usage (disabled if processMeshIndependently=True). Boolean processMeshIndependently If true, each mesh will be processed independently and the triangleCount or ratio will apply by mesh (disable iterative method). Int maxQuadricAge If >0, define the maximum memory (number of collapse) of a vertex before a new evaluation of its quadric.
deleteAttibute
Delete designed attribute on tessellations.
algo.deleteAttibute(occurrence, type)
Parameters
deleteBRepShapes
Delete BRep representation on parts.
algo.deleteBRepShapes(occurrences, onlyTessellated=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean onlyTessellated If 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
Type Name Description OccurrenceList occurrences Occurrences of components to process.
deleteLines
Delete all free line of the mesh of given parts.
algo.deleteLines(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
deleteNormals
Remove normal attributes on tessellations.
algo.deleteNormals(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to delete.
deletePatches
Delete patches attributes on tessellations.
algo.deletePatches(occurrences, keepOnePatchByMaterial=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean keepOnePatchByMaterial If 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
Type Name Description OccurrenceList occurrences Occurrences of components to process.
deleteTangents
Remove tangent attributes on tessellations.
algo.deleteTangents(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to delete.
deleteTextureCoordinates
Delete texture coordinates on tessellations.
algo.deleteTextureCoordinates(occurrences, channel=-1)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Int channel Choose Texture coordinates channel to delete (-1 for all channels).
deleteVisibilityPatches
Delete the visibility patches of given occurrences.
algo.deleteVisibilityPatches(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
evalDecimateErrorForTarget
Returns the max error to set to reach a given target.
algo.evalDecimateErrorForTarget(occurrences, TargetStrategy, boundaryWeight=1., normalWeight=1., UVWeight=1., sharpNormalWeight=1., UVSeamWeight=10., forbidUVFoldovers=True, protectTopology=False) -> core.Double
Parameters
Type Name Description OccurrenceList occurrences List of occurrences to process. DecimateOptionsSelector TargetStrategy Select between targetCount or ratio to define the number of triangles left after the decimation process. Double boundaryWeight Defines how important the edges defining the mesh boundaries (free edges) are during the decimation process, to preserve them from distortion. Double normalWeight Defines how important vertex normals are during the decimation process, to preserve the smoothing of the mesh from being damaged. Double UVWeight Defines how important UVs (texture coordinates) are during the decimation process, to preserve them from being distorted (along with the textures using the UVs). Double sharpNormalWeight Defines how important sharp edges (or hard edges) are during the decimation process, to preserve them from being distorted. Double UVSeamWeight Defines 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). Boolean forbidUVFoldovers Forbids UVs to fold over and overlap each other during the decimation. Boolean protectTopology If 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
Type Name Description Double errorMax Max error that can be used in decimateEdgeCollapse function.
extractNeutralAxis
Extract neutral axis from tessellations.
algo.extractNeutralAxis(occurrences, maxDiameter=100, removeOriginalMesh=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Distance maxDiameter Maximum diameter of beams. Boolean removeOriginalMesh Remove or not the original mesh at the end of the algorithm.
filletMesh
Important
This function is tagged as experimental.
Fillet a mesh according to its Lines of Interest.
algo.filletMesh(occurrences, value, filletingMode=0, subdivisionNb=0, createFlatChamfer=False, material=None, uvChannel=-1)
Parameters
Type Name Description OccurrenceList occurrences Input occurrences. Double value Value (mm). FilletingMode filletingMode Filleting mode. Int subdivisionNb Number of subdivision. Boolean createFlatChamfer If there is 0 subdivision, should the fillet be a planar flat chamfer?. Material material Material to apply to created fillets. Default: use a random neighbor material. Int uvChannel UV Channel for the created fillet polygons. Defaults: Use an existing channel if there is one.
filterHiddenPolygons
Remove hidden polygons using voxels and cavities.
algo.filterHiddenPolygons(occurrences, voxelSize=50)
Parameters
filterMeshVertexColors
Smooth mesh vertex colors by applying to adjacent vertices a combination of different Gaussian filters for feature preservation.
algo.filterMeshVertexColors(occurrences, sigmaPos=5.0, sigmaValue=0.2, sigmaNormal=15.0)
Parameters
Type Name Description OccurrenceList occurrences Mesh occurrences the filter must be applied on. Double sigmaPos Variance of the Gaussian filter applied to distances between adjacent vertex positions. Double sigmaValue Variance of the Gaussian filter applied to differences between adjacent vertex colors (in [0, 1]). Double sigmaNormal Variance of the Gaussian filter applied to angular differences between adjacent vertex normals (in degree).
findBestPivotBetweenOccurrences
Try to compute the pivot point between 2 sets of occurrences.
algo.findBestPivotBetweenOccurrences(assembly1, assembly2, precision=-1) -> geom.Matrix4
Parameters
Returns
Type Name Description Matrix4 matrix Best pivot between the two assembly. If impossible, return the null Matrix4.
getAllAxisFromCADModel
Return all the main axis contained in the CAD models given.
algo.getAllAxisFromCADModel(occurrences) -> scene.OccurrenceList, geom.Matrix4ListList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to check.
Returns
getMeshVertexColors
Returns arrays containing the vertex colors of all meshes being children of the provided occurrence list.
algo.getMeshVertexColors(occurrences) -> core.ColorAlphaListList
Parameters
Type Name Description OccurrenceList occurrences Occurrences from which meshes are gathered.
Returns
Type Name Description ColorAlphaListList vertexColors List of vertex color arrays for each occurrence.
getOptimalTextureResolution
Important
This function is tagged as experimental.
Returns the optimal resolution based on a number of texels per 3D space units (e.g : mm).
algo.getOptimalTextureResolution(occurrences, texelPerMm=2) -> core.Int
Parameters
Type Name Description OccurrenceList occurrences Occurrences on which to compute optimal texture resolution. Double texelPerMm Number of texel per millimeter in a 3D space.
Returns
Type Name Description Int textureResolution
getTessellations
Returns all the tessellation of the given occurrences (only returns editable mesh, see algo.toEditableMesh).
algo.getTessellations(occurrences) -> polygonal.TessellationList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
Returns
Type Name Description TessellationList tessellations All the tessellation of the given occurrences.
getUV3dRatio
Important
This function is tagged as experimental.
Returns the ratio of size between UV and 3D (max value, actually at the 90th percentil).
algo.getUV3dRatio(occurrences) -> core.Double
Parameters
Type Name Description OccurrenceList occurrences Occurrences on which to compute optimal texture resolution.
Returns
Type Name Description Double ratio 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
Type Name Description OccurrenceList occurrences Occurrences of components to process.
Returns
Type Name Description Int visibleCountFront Int visibleCountBack
getVisualComparisonFootprint
Compute the visual footprint of the difference between two sets of occurrences.
algo.getVisualComparisonFootprint(originalOccurrences, comparedOccurrences, resolution=512, viewpointCount=256, threshold=0.2, onHemisphereOnly=False) -> core.Double
Parameters
Type Name Description OccurrenceList originalOccurrences Set of occurrences representing the ground truth. OccurrenceList comparedOccurrences Set of occurrences to compare with the ground truth. Int resolution Resolution of the viewer. Int viewpointCount Number of viewpoints generated around the bounding sphere of all occurrences. Double threshold Tolerance for pixel comparison. Bool onHemisphereOnly Create viewpoints only in the Y+ hemisphere of the bounding sphere.
Returns
Type Name Description Double footprint The visual footprint error in mm (worldspace).
identifyLinesOfInterest
Identify LoI according to given criteria. It will create a new LoI attribute on the mesh that can be used afterward by some functions.
algo.identifyLinesOfInterest(occurrences, normal=False, uvs=False, uvChannels=None, border=False, patches=False, nman=False)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean normal Add LoI on sharp normals. Boolean uvs Add LoI on UV seams. IntList uvChannels If empty and uvs=true, add LoI using all UV channels, else only channel specified in the list. Boolean border Add LoI on boundary edges. Boolean patches Add LoI on submesh borders. Boolean nman Add LoI on non-manifolds edges.
identifyPatches
Create patches (submeshes) on meshes (needed by some functions).
algo.identifyPatches(occurrences, useAttributesFilter=True, sharpAngleFilter=45, useBoundaryFilter=True, useNonManifoldFilter=True, useLineEdgeFilter=True, useQuadLineFilter=False)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean useAttributesFilter Filters by attributes. Angle sharpAngleFilter Sharp angle in degree to filter by edges sharpness, if the angle is negative do not filter. Boolean useBoundaryFilter Filters by boundaries. Boolean useNonManifoldFilter Filters by manifold-ness. Boolean useLineEdgeFilter Filters by edge. Boolean useQuadLineFilter Filters by quad lines.
identifySharpEdges
Important
This function is tagged as experimental.
Mark as Lines Of Interest the sharp edges .
algo.identifySharpEdges(occurrences, minSharpAngle=90, maxSharpAngle=180, convexity=2, onlyExplicitSharp=False)
Parameters
Type Name Description OccurrenceList occurrences Input occurrences. Angle minSharpAngle The angle between the normals - all edges sharpest than this will be filleted. Angle maxSharpAngle All edges sharpest than this won't be filleted. ConvexityFilter convexity Fillet sharp edges that are convex, concave or both. Boolean onlyExplicitSharp If toggled, if the explicit normals of an edge says the transition is smooth, the edge won't be selected.
invertTangents
Invert tangents orientation (usefull to switch between right-handed/left-handed normal maps.
algo.invertTangents(occurrences, invertW=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences to invert tangents on. Boolean invertW If true, only inverse the w components of tangent. Else, inverse the xyz vector.
lineToTexture
Important
This function is tagged as experimental.
Generate a textured quadrangle over an existing mesh of coplanar lines.
algo.lineToTexture(lines, useColor, resolution=512, thickness=5)
Parameters
Type Name Description OccurrenceList lines Lines to select. UseColorOption useColor Set color policy. Int resolution Texture resolution. Int thickness The thickness of the lines in pixels.
listFeatures
List features from tessellations.
algo.listFeatures(occurrences, throughHoles=True, blindHoles=False, maxDiameter=-1) -> algo.OccurrenceFeaturesList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean throughHoles List through holes. Boolean blindHoles List blind holes. Distance maxDiameter Maximum diameter of the holes to be list (-1=no max diameter).
Returns
loopSubdivMesh
Apply Loop Subdivision on Triangle-only Mesh.
algo.loopSubdivMesh(occurrences, depth=1)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Int depth Subdivision depth.
mergeVertices
Merge near vertices according to the given distance.
algo.mergeVertices(occurrences, maxDistance, mask)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Distance maxDistance Maximum distance between two vertex to merge. TopologyCategoryMask mask Topological category of the vertices to merge.
meshBooleanOperation
Important
This function is tagged as experimental.
Computes the boolean operation between the meshes of two occurrence lists.
algo.meshBooleanOperation(occurrencesA, occurrencesB, operation) -> scene.Occurrence
Parameters
Returns
Type Name Description Occurrence occurrence A new Occurrence bearing the result.
meshComparison
Important
This function is tagged as experimental.
Compare two meshes.
algo.meshComparison(mesh_1, mesh_2) -> geom.Distance
Parameters
Returns
Type Name Description Distance distance Disance between two meshes.
meshComparisonBatch
Important
This function is tagged as experimental.
Compare each couple of meshes and returns the maximum for each couple.
algo.meshComparisonBatch(meshes1, meshes2) -> geom.DistanceList
Parameters
Returns
Type Name Description DistanceList distances Disance between each couple of meshes.
meshIntersections
Important
This function is tagged as experimental.
Computes the list of polylines at the intersections of the meshes of two occurrence lists.
algo.meshIntersections(occurrencesA, occurrencesB) -> geom.Point3ListList
Parameters
Returns
noiseMesh
Apply noise to vertex positions along their normals.
algo.noiseMesh(occurrences, maxAmplitude=1)
Parameters
Type Name Description OccurrenceList occurrences Part occurrencess to noise. Distance maxAmplitude Maximum distance between original vertex and noisy vertex.
optimizeCADLoops
Optimize CAD Face loops by merging useless loop edges.
algo.optimizeCADLoops(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to optimize.
optimizeForRendering
Optimize mesh for rendering (lossless, only reindexing).
algo.optimizeForRendering(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to optimize.
optimizeSubMeshes
Sort sub meshes by materials.
algo.optimizeSubMeshes(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Part occurrencess to process.
optimizeTextureSize
Important
This function is tagged as experimental.
Resizes scene textures based on a number of texels per 3D space units (e.g: mm).
algo.optimizeTextureSize(root, texelPerMm=2)
Parameters
Type Name Description Occurrence root Root from which texture resizing will process. Double texelPerMm Number 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
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean throughHoles Remove through holes. Boolean blindHoles Remove blind holes. Boolean surfacicHoles Remove surfacic holes. Distance maxDiameter Maximum diameter of the holes to be removed (-1=no max diameter). Material fillWithMaterial If 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
Type Name Description OccurrenceList occurrences Occurrences of components to clean. Distance tolerance Tolerance. Boolean orient If true reorient the model.
segmentMesh
Important
This function is tagged as experimental.
Segment Mesh into clusters guided by edge sharpnesses.
algo.segmentMesh(occurrences, overwriteLoI=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean overwriteLoI Overwrite the lines-of-interest parameters if true, else add them.
setFeatureComponentMaxIndex
Remap Index map of each FeatureComponent of selected occurrences.
algo.setFeatureComponentMaxIndex(occurrences, maxIndex)
Parameters
setMeshVertexColors
Specify vertex colors for all meshes being children of the provided occurrence list.
algo.setMeshVertexColors(occurrences, vertexColors)
Parameters
Type Name Description OccurrenceList occurrences Occurrences from which meshes are gathered. ColorAlphaListList vertexColors List of vertex color arrays for each occurrence.
smoothMesh
algo.smoothMesh(occurrences, mode, maxIterations=100, lockSignificantEdges=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. CostEvaluation mode Computation of cost. Int maxIterations Maximum number of swapping iteration. Boolean lockSignificantEdges Forbid to swap significant edges (e.g. UV seams, sharp edges, patch borders, ...).
splitUVForAtlas
algo.splitUVForAtlas(occurrences)
Parameters
sweep
Important
This function is tagged as experimental.
Extrudes a circular section along an underlying polyline (curve).
algo.sweep(occurrences, radius=1, sides=10, createNormals=True, keepLines=False, generateUV=True)
Parameters
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
Type Name Description OccurrenceList occurrences Occurrences of components to tessellate. Distance maxSag Maximum distance between the geometry and the tessellation. Distance maxLength Maximum length of elements. Angle maxAngle Maximum angle between normals of two adjacent elements. Boolean createNormals If true, normals will be generated. UVGenerationMode uvMode Select the texture coordinates generation mode. Int uvChannel The UV channel of the generated texture coordinates (if any). Double uvPadding The 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. Boolean createTangents If true, tangents will be generated. Boolean createFreeEdges If true, free edges will be created for each patch borders. Boolean keepBRepShape If true, BRep shapes will be kept for Back to Brep or Retessellate. Boolean overrideExistingTessellation If true, already tessellated parts will be re-tessellated.
tessellatePointClouds
Important
This function is tagged as experimental.
Tessellate point clouds to replace the geometry with a polygonal connect mesh.
algo.tessellatePointClouds(occurrences, kNeighbors=20, keepPoints=False, colorize=True)
Parameters
Type Name Description OccurrenceList occurrences Int kNeighbors The number of neighbor points used to compute normals. Boolean keepPoints Keep points after meshing if enabled. Boolean colorize If 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
Type Name Description OccurrenceList occurrences Occurrences of components to tessellate. Distance maxSag Maximum distance between the geometry and the tessellation. Double sagRatio Maximum ratio distance between the geometry and the tessellation. Distance maxLength Maximum length of elements. Angle maxAngle Maximum angle between normals of two adjacent elements. Boolean createNormals If true, normals will be generated. UVGenerationMode uvMode Select the texture coordinates generation mode. Int uvChannel The UV channel of the generated texture coordinates (if any). Double uvPadding The 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. Boolean createTangents If true, tangents will be generated. Boolean createFreeEdges If true, free edges will be created for each patch borders. Boolean keepBRepShape If true, BRep shapes will be kept for Back to Brep or Retessellate. Boolean overrideExistingTessellation If true, already tessellated parts will be re-tessellated.
transferUV
Transfer UV from a mesh to another mesh.
algo.transferUV(source, destination, sourceChannel=0, destinationChannel=0, tolerance=0.001)
Parameters
Type Name Description Occurrence source Occurrence of the source mesh. Occurrence destination Occurrence of the destination mesh. Int sourceChannel Source UV channel to bake. Int destinationChannel Destination UV channel to bake to. Distance tolerance Geometric tolerance for point projection.
voxelizePointClouds
Explode point clouds to voxels.
algo.voxelizePointClouds(occurrences, voxelSize=500)
Parameters
Baking
bakeAOMap
Ray tracing based ambient occlusion computation.
algo.bakeAOMap(sessionId, samples=32, bentNormals=False, defaultColor=core.ColorAlpha(0., 0., 0., 0.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. Int samples Number of rays cast for occlusion detection (must be a power of two in the range [8, 4096]). Boolean bentNormals If true, bent normals are baked in addition to AO. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps: one per destination if shareMaps is false, two if bentNormals is true. In that case, maps are returned in an interleaved manner: [destOccAO0, destOccBentNorm0, destOccAO1, destOccBentNorm1, ...]).
See also:
bakeDepthMap
Depth map baking.
algo.bakeDepthMap(sessionId, normalizeValue=1.0, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. Double normalizeValue Divisor applied to depth values before storage to texture. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeDiffuseMap
Diffuse map baking.
algo.bakeDiffuseMap(sessionId, withTransparency=False, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. Boolean withTransparency If true, surface transparency is stored in the alpha channel. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeDisplacementMap
Displacement map baking.
algo.bakeDisplacementMap(sessionId, normalize=True, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. Boolean normalize If true, displacement vectors are remapped to [-1,1]. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeEmissiveMap
Emissive map baking.
algo.bakeEmissiveMap(sessionId, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeFeatureMap
Feature map baking.
algo.bakeFeatureMap(sessionId, defaultColor=core.ColorAlpha(1., 1., 1., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeMaterialAOMap
AO baking from the source material.
algo.bakeMaterialAOMap(sessionId, defaultColor=core.ColorAlpha(1., 1., 1., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeMaterialIdMap
Color map baking based on source material Ids.
algo.bakeMaterialIdMap(sessionId, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeMaterialPropertyMap
Baking of custom material properties.
algo.bakeMaterialPropertyMap(sessionId, propertyName=String(), nComponents=3, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. String propertyName Name of the material property to bake (must be a color, a coeff or a texture). Int nComponents Expected number of components per pixel for the resulting maps. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeMetallicMap
Metallic map baking.
algo.bakeMetallicMap(sessionId, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeNormalMap
Normal map baking.
algo.bakeNormalMap(sessionId, sourceSpace=2, destinationSpace=2, defaultColor=core.ColorAlpha(1., 1., 1., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. Space sourceSpace The space in which source normal vectors are defined. Space destinationSpace The space in which destination normal vectors are defined. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeOccurrencePropertyMap
Occurrence property map baking.
algo.bakeOccurrencePropertyMap(sessionId, propertyName=String(), nComponents=3, defaultColor=core.ColorAlpha(1., 1., 1., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. String propertyName Name of the occurrence property to bake (must be a color, a coeff or a texture). Int nComponents Expected number of components per pixel for the resulting maps. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeOpacityMap
Opacity map baking.
algo.bakeOpacityMap(sessionId, defaultColor=core.ColorAlpha(1., 1., 1., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakePartIdMap
Color map baking based on the source part Ids.
algo.bakePartIdMap(sessionId, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakePositionMap
Position map baking.
algo.bakePositionMap(sessionId, local=False, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. Boolean local If true, position is baked in local space, otherwise in global space. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeRoughnessMap
Roughness map baking.
algo.bakeRoughnessMap(sessionId, defaultColor=core.ColorAlpha(0.5, 0.5, 0.5, 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeSpecularMap
Specular map baking.
algo.bakeSpecularMap(sessionId, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeUVMap
Source UV coordinates baking.
algo.bakeUVMap(sessionId, uvChannel=0, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. Int uvChannel The channel from which UVs are baked. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeValidityMap
Validity map baking, distinguishing baked pixels from non baked pixels.
algo.bakeValidityMap(sessionId, validValue=1., invalidValue=0.) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. Double validValue Value used for filling baked texels. Double invalidValue Value used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
bakeVertexColorMap
Vertex color map baking.
algo.bakeVertexColorMap(sessionId, defaultColor=core.ColorAlpha(0., 0., 0., 1.)) -> material.ImageList
Parameters
Type Name Description BakingSession sessionId Baking session Id. ColorAlpha defaultColor Color used for filling unbaked texels.
Returns
Type Name Description ImageList images Resulting baked maps (one per destination if shareMaps is false).
See also:
beginBakingSession
Start a new baking session. This must be called prior to any of the bake*Something*Map function.
algo.beginBakingSession(destinationOccurrences, sourceOccurrences=[], uvChannel=0, resolution=1024, rayOffset=0, rayMaxDist=-1, opacityThreshold=-1, useCurrentPosition=False, shareMaps=True, sourceElements=0) -> algo.BakingSession
Parameters
Type Name Description OccurrenceList destinationOccurrences Occurrences of the meshes where to store the baked map. OccurrenceList sourceOccurrences Occurrences of components from which to bake maps (if empty use destination). Int uvChannel UV channel of destOccurrence to use for the map generation. Int resolution Map resolution. Distance rayOffset Offset from source mesh. Distance rayMaxDist Maximum search distance for ray tracing during baking computation (-1 means infinity). Coeff opacityThreshold If the opacity is under this threshold, considers as fully transparent and store the color behind the intersection. Boolean useCurrentPosition Use the current position instead of the T-Pose of the input occurrence. Boolean shareMaps If true, all the destinationOccurrences will share the same maps. ElementFilter sourceElements Defines the type of elements from which baking is performed (polygons or points).
Returns
Type Name Description BakingSession bakingsession Created baking session identifier.
See also:
beginVertexBakingSession
Start a new baking session. This must be called prior to any of the bake*Something*Map function.
algo.beginVertexBakingSession(destinationOccurrences, sourceOccurrences=[], rayOffset=0, rayMaxDist=-1, opacityThreshold=-1, useCurrentPosition=False, sourceElements=0) -> algo.BakingSession
Parameters
Type Name Description OccurrenceList destinationOccurrences Occurrences of the meshes where to store the baked map. OccurrenceList sourceOccurrences Occurrences of components from which to bake maps (if empty use destination). Distance rayOffset Offset from source mesh. Distance rayMaxDist Maximum search distance for ray tracing during baking computation (-1 means infinity). Coeff opacityThreshold If the opacity is under this threshold, considers as fully transparent and store the color behind the intersection. Boolean useCurrentPosition Use the current position instead of the T-Pose of the input occurrence. ElementFilter sourceElements Defines the type of elements from which baking is performed (polygons or points).
Returns
Type Name Description BakingSession bakingsession Created baking session identifier.
See also:
combineMaterials
Combine materials found on occurrences subtrees into one baked material and assign it to part occurrences.
algo.combineMaterials(occurrences, bakingOptions, overrideExistingUVs=True, singularizeOnAO=False)
Parameters
Type Name Description OccurrenceList occurrences Root occurrences to process. BakeOption bakingOptions Baking options. Boolean overrideExistingUVs If true, use axis-aligned bounding box mapping to regenerate new UVs, instead of repacking existing ones from channel 0. Boolean singularizeOnAO If true, singularize all instances in the selected subtree if we want to bake AO in the texture.
See also:
endBakingSession
End and destroy an existing baking session.
algo.endBakingSession(sessionId)
Parameters
Type Name Description BakingSession sessionId Id of the baking session to end.
See also:
fetchBakedMap
Returns information about one texel of a baked map (occurrence, polygon ID, parametric coordinates, material ID). Must be called inside a (begin/end)BakingSession block.
algo.fetchBakedMap(sessionId, x, y, mapId=0) -> algo.BakedValue
Parameters
Type Name Description BakingSession sessionId Baking session Id. UInt x X coordinate of the map pixel to fetch. UInt y Y coordinate of the map pixel to fetch. UInt mapId Id of the map to fetch, if several are available.
Returns
See also:
fetchBakedVertex
Returns information about a baked vertex (occurrence, polygon ID, parametric coordinates, material ID). Must be called inside a (begin/end)BakingSession block.
algo.fetchBakedVertex(sessionId, n, dstId=0) -> algo.BakedValue
Parameters
Type Name Description BakingSession sessionId Baking session Id. UInt n ID of the vertex to check. UInt dstId Id of the destination occurrence the vertex belongs to, if several are provided.
Returns
See also:
setBakingSessionPadding
Change the dilation applied to maps baked from the given session. All maps baked after the call to this function will be affected by the new value. The default value of a newly created session is 2.
algo.setBakingSessionPadding(sessionId, padding)
Parameters
Type Name Description BakingSession sessionId Baking session Id. Int padding Number of pixels to fill around baked islands. -1 means infinite dilation.
See also:
Decomposition
convexDecomposition
Important
This function is tagged as experimental.
Explode each mesh to approximated convex decomposition.
algo.convexDecomposition(occurrences, maxCount=1024, vertexCount=64, approximate=True, resolution=100000, concavity=0.001) -> scene.OccurrenceList
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int maxCount Maximum number of convex hull to generated. Int vertexCount Maximum number of vertices per convex hull. Boolean approximate Approximate method. Int resolution Resolution. Double concavity Concavity.
Returns
Type Name Description OccurrenceList newOccurrences Resulting occurrences of the convexDecomposition.
See also:
explodeBodies
Explode all CAD Parts by body. New parts will be placed as children of input part occurrences.
algo.explodeBodies(occurrences, groupOpenShells=False)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Boolean groupOpenShells Group all open shells in one part.
See also:
explodeByMaterials
Explode all parts by material. New parts will be placed as children of input part occurrences.
algo.explodeByMaterials(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process.
See also:
explodeByTopoDimension
Separate polygons, lines and points into different occurrences.
algo.explodeByTopoDimension(occurrences) -> scene.OccurrenceList
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process.
Returns
Type Name Description OccurrenceList newOccurrences List of created occurrences containing only one type : polygons, lines or points.
See also:
explodeByVertexCount
Explode part occurrences to respect a maximum vertex count.
algo.explodeByVertexCount(occurrences, maxVertexCount=65534, maxTriangleCount=65534, countMergedVerticesOnce=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int maxVertexCount The maximum number of vertices by part. Int maxTriangleCount The maximum number of triangles by part (quadrangles count twice). Boolean countMergedVerticesOnce If true, one vertex used in several triangles with different normals will be counted once (for Unity must be False).
See also:
explodeByVoxel
Important
This function is tagged as experimental.
Explode parts by voxel. New parts will be placed as children of input part occurrences.
algo.explodeByVoxel(occurrences, voxelSize=500)
Parameters
See also:
explodeConnectedMeshes
Explode connected set of polygons to part occurrences. New parts will be placed as children of input part occurrences.
algo.explodeConnectedMeshes(occurrences, explodeNonManifoldEdges=False)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Boolean explodeNonManifoldEdges Split connected components along non-manifold edges.
See also:
explodePatches
Explode all parts by patch.
algo.explodePatches(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process.
See also:
Occlusion Detection
createVisibilityInformation
Create visilibity information on part occurrences viewed from a set of camera automatically placed on a sphere around the scene.
algo.createVisibilityInformation(occurrences, level=0, resolution=1024, sphereCount=256, fovX=90, considerTransparentOpaque=False, root=0, onHemisphereOnly=False)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. SelectionLevel level Level of geometries to create visibility information on: Parts, Patches or Polygons. Int resolution Resolution of the visibility viewer. Int sphereCount Number of viewpoints generated around the bounding sphere. Double fovX Horizontal field of view (in degree). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Occurrence root Specify another root for occluder scene. Bool onHemisphereOnly Create viewpoints only in the Y+ hemisphere of the bounding sphere.
See also:
createVisibilityInformationAdvanced
Create visilibity information on part occurrences viewed from a set of voxel based view points.
algo.createVisibilityInformationAdvanced(occurrences, level=0, voxelSize=100, minimumCavityVolume=1, resolution=256, mode=0, considerTransparentOpaque=False, root=0)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. SelectionLevel level Level of geometries to create visibility information on: Parts, Patches or Polygons. Distance voxelSize Size of the voxels in mm (smaller it is, more viewpoints there are). Volume minimumCavityVolume Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are). Int resolution Resolution of the visibility viewer. InnerOuterOption mode Select where to place camera (all cavities, only outer or only inner cavities). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Occurrence root Specify another root for occluder scene.
See also:
createVisibilityInformationFromViewPoints
Create visilibity information on parts viewed from a given set of camera.
algo.createVisibilityInformationFromViewPoints(occurrences, cameraPositions, cameraDirections, cameraUps, resolution=1024, fovX=90, considerTransparentOpaque=False, root=0)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Point3List cameraPositions List of camera positions. Point3List cameraDirections List of camera directions. Point3List cameraUps List of camera up vectors. Int resolution Resolution of the visibility viewer. Double fovX Horizontal field of view (in degree). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Occurrence root Specify another root for occluder scene.
See also:
findOccludedPartOccurrences
Get part occurrences not viewed from a sphere around the scene.
algo.findOccludedPartOccurrences(occurrences, resolution=1024, sphereCount=256, fovX=90, considerTransparentOpaque=False, root=0, onHemisphereOnly=False) -> scene.OccurrenceList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Int resolution Resolution of the visibility viewer. Int sphereCount Number of viewpoints generated around the bounding sphere. Double fovX Horizontal field of view (in degree). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Occurrence root Specify another root for occluder scene. Bool onHemisphereOnly Create viewpoints only in the Y+ hemisphere of the bounding sphere.
Returns
Type Name Description OccurrenceList filtered The list of occurrences meeting the criteria.
See also:
findOccludedPartOccurrencesAdvanced
Get part occurrences not viewed from a set of voxel based view points.
algo.findOccludedPartOccurrencesAdvanced(occurrences, voxelSize=100, minimumCavityVolume=1, resolution=256, mode=0, considerTransparentOpaque=False, root=0) -> scene.OccurrenceList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Distance voxelSize Size of the voxels in mm (smaller it is, more viewpoints there are). Volume minimumCavityVolume Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are). Int resolution Resolution of the visibility viewer. InnerOuterOption mode Select where to place camera (all cavities, only outer or only inner cavities). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Occurrence root Specify another root for occluder scene.
Returns
Type Name Description OccurrenceList filtered The list of occurrences meeting the criteria.
See also:
removeOccludedGeometries
Delete part occurrences, patches or polygons not viewed from a sphere around the scene.
algo.removeOccludedGeometries(occurrences, level=0, resolution=1024, sphereCount=256, fovX=90, considerTransparentOpaque=False, adjacencyDepth=1, occluders=[], onHemisphereOnly=False) -> core.BoolList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. SelectionLevel level Level of geometries to remove : Parts, Patches or Polygons. Int resolution Resolution of the visibility viewer. Int sphereCount Number of viewpoints generated around the bounding sphere. Double fovX Horizontal field of view (in degree). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Int adjacencyDepth Mark neighbors polygons as visible. OccurrenceList occluders Specify other occurrences for occluder scene. Bool onHemisphereOnly Create viewpoints only in the Y+ hemisphere of the bounding sphere.
Returns
Type Name Description BoolList viewedOccurrences For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True).
See also:
removeOccludedGeometriesAdvanced
Delete part occurrences, patches or polygons not seen from voxel based view points.
algo.removeOccludedGeometriesAdvanced(occurrences, level=0, voxelSize=100, minimumCavityVolume=1, resolution=256, mode=0, considerTransparentOpaque=False, adjacencyDepth=1, occluders=[]) -> core.BoolList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. SelectionLevel level Level of geometries to remove : Parts, Patches or Polygons. Distance voxelSize Size of the voxels in mm (smaller it is, more viewpoints there are). Volume minimumCavityVolume Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are). Int resolution Resolution of the visibility viewer. InnerOuterOption mode Select where to place camera (all cavities, only outer or only inner cavities). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Int adjacencyDepth Mark neighbors polygons as visible. OccurrenceList occluders Specify other occurrences for occluder scene.
Returns
Type Name Description BoolList viewedOccurrences For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True).
See also:
removeOccludedGeometriesFromPoints
Delete part occurrences, patches or polygons not viewed from spheres generated with a set of camera position.
algo.removeOccludedGeometriesFromPoints(occurrences, level=0, positions, resolution=1024, sphereCount=256, fovX=90, considerTransparentOpaque=False, adjacencyDepth=1, occluders=[]) -> core.BoolList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. SelectionLevel level Level of parts to remove : Parts, Patches or Polygons. Point3List positions List of positions. Int resolution Resolution of the visibility viewer. Int sphereCount Number of viewpoints generated around the bounding sphere. Double fovX Horizontal field of view (in degree). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Int adjacencyDepth Mark neighbors polygons as visible. OccurrenceList occluders Specify other occurrences for occluder scene.
Returns
Type Name Description BoolList viewedOccurrences For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True).
See also:
removeOccludedGeometriesFromViewPoints
Delete part occurrences, patches or polygons not viewed from a set of camera position/orientation.
algo.removeOccludedGeometriesFromViewPoints(occurrences, level=0, positions, directions, ups, resolution=1024, fovX=90, considerTransparentOpaque=False, adjacencyDepth=1, occluders=[]) -> core.BoolList
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. SelectionLevel level Level of geometries to remove : Parts, Patches or Polygons. Point3List positions List of positions. Point3List directions List of directions. Point3List ups List of up vectors. Int resolution Resolution of the visibility viewer. Double fovX Horizontal field of view (in degree). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. Int adjacencyDepth Mark neighbors polygons as visible. OccurrenceList occluders Specify other occurrences for occluder scene.
Returns
Type Name Description BoolList viewedOccurrences For each occurrence in occurrences, tell if the occurrence has been viewed (True) or not (True).
See also:
Reconstruction
createOcclusionMesh
Important
This function is tagged as experimental.
Compute an occluder or an occludee with the occurrences selected.
algo.createOcclusionMesh(occurrences, type=1, voxelSize=50, gap=1) -> scene.Occurrence
Parameters
Returns
Type Name Description Occurrence occlusionPart Resulting part occurrence.
See also:
dualContouring
Important
This function is tagged as experimental.
Replace the tessellations of the selected parts by a retopology based on a dual-contouring.
algo.dualContouring(occurrences, filteringSize=200, voxelSize=50, tolerance=0.01, sameSizeOnAllAxis=False) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Occurrences of part to process. Distance filteringSize Filtering size - must be a multiple of 2 of voxelSize. Distance voxelSize Voxel size used for the reconstruction. Double tolerance Tolerance for the quadric error used for the simplification of the octree. Boolean sameSizeOnAllAxis If true, use the maximum axis length of the AABB for all axis.
Returns
Type Name Description Occurrence dualContouredPart Resulting part occurrence.
See also:
marchingCubes
Replace the tessellations of the selected parts by a marching cube representation.
algo.marchingCubes(occurrences, voxelSize=50, elements=0, dilation=0, surfacic=False) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Distance voxelSize Size of voxels. ElementFilter elements Type of elements used to detect the voxels, polygons or points or hybrid. Int dilation Dilation iterations on the voxel grid (only if surfacic=false). Boolean surfacic Prefer this mode if the source is surfacic, the result is not guaranteed to be watertight.
Returns
Type Name Description Occurrence marchingCubePart Resulting part occurrence.
See also:
proxyMesh
Replace the tessellations of the selected parts by a proxy mesh based on a voxelization.
algo.proxyMesh(occurrences, voxelSize=50, elements=0, dilation=0, surfacic=False) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Distance voxelSize Size of voxels. ElementFilter elements Type of elements used to detect the voxels, polygons or points or hybrid. Int dilation Dilation iterations on the voxel grid (only if surfacic=false). Boolean surfacic Prefer this mode if the source is surfacic, the result is not guaranteed to be watertight.
Returns
Type Name Description Occurrence proxyMeshPart Resulting part occurrence.
See also:
retopologize
Important
This function is tagged as experimental.
Replace the tessellations of the selected parts by a retopology of the external hull.
algo.retopologize(occurrences, targetTriangleCount=1000, pureQuad=True, pointCloud=False, precision=-1) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int targetTriangleCount Target triangle count. Bool pureQuad Retopologize to a pure quad mesh if True, else the resulting mesh will be quad dominant but can contains triangles. Bool pointCloud Set to true if occurrences are point cloud, else False. Distance precision If set, define the precision of the features to preserve.
Returns
Type Name Description Occurrence retopologizedPart Resulting part occurrence.
See also:
voxelize
Replace the tessellations of the selected parts by a voxelization of the external skin.
algo.voxelize(occurrences, voxelSize=50, elements=0, dilation=0, useCurrentAnimationPosition=False) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Distance voxelSize Size of voxels. ElementFilter elements Type of elements used to detect the voxels, polygons or points or hybrid. Int dilation Dilation iterations on the voxel grid. Boolean useCurrentAnimationPosition Use the current animation position instead of the t-pose.
Returns
Type Name Description Occurrence voxelizedPart Resulting part occurrence.
See also:
Replacement
replaceBy
Replace geometries by other shapes, or primitives.
algo.replaceBy(occurrences, replaceBy=["Occurrence", algo.ReplaceByOccurrenceOptions(0, False)])
Parameters
See also:
replaceByBox
Replace objects by a bounding box.
algo.replaceByBox(occurrences, boxType)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to replace. ReplaceByBoxType boxType Bounding box type, oriented, axis-aligned, ...
See also:
replaceByConvexHull
Important
This function is tagged as experimental.
Replace objects by convex hull.
algo.replaceByConvexHull(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to replace.
See also:
replaceByPrimitive
Replace objects by a primitive shapes.
algo.replaceByPrimitive(occurrences, primitive, generateUV=True)
Parameters
See also:
Sawing
sawWithAABB
Saw the mesh with an axis-aligned bounding box. New parts will be placed as children of input part occurrences.
algo.sawWithAABB(occurrences, aabb, mode, innerSuffix="_inner", outerSuffix="_outer")
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. AABB aabb Axis-Aligned Bounding Box. SawingMode mode The sawing mode. String innerSuffix Only if mode is set to SawAndSplit, set the suffix of the inner part. String outerSuffix Only if mode is set to SawAndSplit, set the suffix of the outer part.
See also:
sawWithOBB
Saw the mesh with an oriented bounding box. New parts will be placed as children of input part occurrences.
algo.sawWithOBB(occurrences, obb, mode, innerSuffix="_inner", outerSuffix="_outer")
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. OBB obb Minimum Bounding Box. SawingMode mode The sawing mode. String innerSuffix Only if mode is set to SawAndSplit, set the suffix of the inner part. String outerSuffix Only if mode is set to SawAndSplit, set the suffix of the outer part.
See also:
sawWithOctree
Saw and split the mesh with an octree. New parts will be placed as children of input part occurrences.
algo.sawWithOctree(occurrences, aabb, maxDepth, maxTrianglesByLeaf=-1, sawTolerance=0) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. AABB aabb Octree Bounding Box. Int maxDepth Depth of the octree. Int maxTrianglesByLeaf Set the maximum triangle count on the leaf of the octree ( -1 to not use ). Double sawTolerance Size in mm of the tolerance of the saw.
Returns
Type Name Description Occurrence octreeRoot Root occurrence of the created octree.
See also:
sawWithPlane
Saw the mesh with a plane. New parts will be placed as children of input part occurrences.
algo.sawWithPlane(occurrences, planeOrigin, planeNormal, mode, innerSuffix="_inner", outerSuffix="_outer", tolerance=0)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Point3 planeOrigin The plane origin. Vector3 planeNormal The plane normal. SawingMode mode The sawing mode. String innerSuffix Only if mode is set to SawAndSplit, set the suffix of the inner part. String outerSuffix Only if mode is set to SawAndSplit, set the suffix of the outer part. Double tolerance Set a tolerance to make the saw lose.
See also:
Similarity detection
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).
algo.convertSimilarPartOccurrencesToInstances(occurrences, checkMeshTopo=True, checkVertexPositions=True, vertexPositionPrecision=5, checkUVTopo=True, checkUVVertexPositions=True, UVPositionprecision=5)
Parameters
Type Name Description OccurrenceList occurrences Occurrence for which we want to find similar parts and create instances using prototypes. Boolean checkMeshTopo Boolean checkVertexPositions Int vertexPositionPrecision Boolean checkUVTopo Boolean checkUVVertexPositions Int UVPositionprecision
See also:
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.
algo.convertSimilarPartOccurrencesToInstancesFast(occurrences, dimensionsSimilarity=0.98, polycountSimilarity=0.98, ignoreSymmetry=False)
Parameters
Type Name Description OccurrenceList occurrences Root occurrences for which we want to find similar part occurrences and create instances using prototypes. Coeff dimensionsSimilarity The 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. Coeff polycountSimilarity The 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. Boolean ignoreSymmetry If True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.
See also:
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.
algo.findSimilarPartOccurrencesFast(occurrences, dimensionsSimilarity=0.98, polycountSimilarity=0.98, ignoreSymmetry=False) -> scene.OccurrenceList
Parameters
Type Name Description OccurrenceList occurrences Occurrences for which we want to find similar part occurrences in the scene. Coeff dimensionsSimilarity The 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. Coeff polycountSimilarity The 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. Boolean ignoreSymmetry If True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.
Returns
Type Name Description OccurrenceList filtered The list of part occurrences meeting the criteria.
See also:
UV Mapping
alignUVIslands
Important
This function is tagged as experimental.
Align with the axes the UVs of the islands.
algo.alignUVIslands(occurrences, channel=0, usePolygonsWeights=0, useVerticesWeights=0, alignmentMode=0)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel UV channel to merge. Double usePolygonsWeights Use polygons weights to give more importance to what must be aligned. Double useVerticesWeights Use vertices weights to give more importance to what must be aligned. AlignmentMode alignmentMode With which axis the UVs should be aligned.
See also:
applyUvTransform
Apply a transformation matrix on texture coordinates.
algo.applyUvTransform(occurrences, matrix, channel=0)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Matrix4 matrix Transformationmatrix. Int channel UV channel to transform.
See also:
automaticUVMapping
Important
This function is tagged as experimental.
Generates the texture coordinates and automatically find seams.
algo.automaticUVMapping(occurrences, channel=0, maxAngleDistorsion=0.5, maxAreaDistorsion=-1, sharpToSeam=True, forbidOverlapping=True, resolution=1024, padding=1)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel The UV channel which will contains the texture coordinates. Double maxAngleDistorsion Maximum angle distorsion 2PI-SumVtxAng /2PI. Double maxAreaDistorsion Maximum area distorsion before scale to 1. 2DArea-3DArea /3DArea . Bool sharpToSeam If enabled, sharp edges are automatically considered as UV seams. Bool forbidOverlapping If enabled, UV cannot overlap. UInt resolution Resolution wanted for the final map when repacking at the end. UInt padding Set the padding (in pixels) between UV islands when repacking at the end.
See also:
copyUV
Copy an UV channel to another UV channel.
algo.copyUV(occurrences, sourceChannel=0, destinationChannel=0)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int sourceChannel The source UV channel to copy. Int destinationChannel The destination UV channel to copy into.
See also:
getRatioUV3D
Compute the ratio between the UV and the 3D size.
algo.getRatioUV3D(occurrences, ratioMode, channel=0) -> core.DoubleList
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. RatioUV3DMode ratioMode Choose how to compute the ratio. Int channel UV channel to use.
Returns
Type Name Description DoubleList ratios Ratios 3Dsize/UVsize of the input occurrences.
See also:
getUVQualityMetrics
Compute UV mapping qualitative metrics.
algo.getUVQualityMetrics(occurrences, channel=0) -> core.UInt, core.Double, core.Double, core.Double, core.Double, core.Double
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. UInt channel UV channel to use.
Returns
Type Name Description UInt chartCount Number of UV islands. If 0, all other returns are invalid. Double area3D 3D area (sum of 3D triangle areas). Double area2D 2D area (sum of UV-space triangle area). Double occupancy UV-space occupation (i.e., 2D area over AABR area). Double crumbliness Crumbliness (i.e., a measure of how intricate the UV-island borders are, basically a measure of deviation from a perfect disc). Double samplingStd Sampling standard deviation (i.e., measure of variation over the mesh of triangle sampling rate, that is ratio of their 2D over 3D area).
See also:
getUvAabr
Compute the UV Axis Aligned Bounding Rectangle of a set of occurrences.
algo.getUvAabr(occurrences, channel=0) -> geom.AABR
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel UV channel to transform.
Returns
Type Name Description AABR aabr The UV AABR.
See also:
hasOverlappingUV
Check if a UV channel contains overlapping UVs.
algo.hasOverlappingUV(occurrences, channel=0, resolution=1024) -> core.Boolean
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. UInt channel UV channel to use. UInt resolution Resolution of rasterization grid used to check for overlaps.
Returns
Type Name Description Boolean hasOverlappingUVs True if overlapping UVs found.
See also:
mapUvOnAABB
Generate texture coordinates using the projection on object Axis Aligned Bounding Box.
algo.mapUvOnAABB(occurrences, useLocalAABB=False, uv3dSize=100, channel=0, overrideExistingUVs=True, ignoreScale=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Bool useLocalAABB If enabled, uses part own bounding box, else use global one. Distance uv3dSize 3D size of the UV space [0-1]. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel. Boolean ignoreScale If this and useLocalAABB are true, ignore local scale.
See also:
mapUvOnBox
Generate texture coordinates using the projection on a box.
algo.mapUvOnBox(occurrences, box, channel=0, overrideExistingUVs=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Box box Box definition. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel.
See also:
mapUvOnCubicAABB
Generate texture coordinates using the projection on object AABB, with same scale on each axis.
algo.mapUvOnCubicAABB(occurrences, uv3dSize=100, channel=0, overrideExistingUVs=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Distance uv3dSize 3D size of the UV space [0-1]. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel.
See also:
mapUvOnCustomAABB
Generate texture coordinates using the projection on custom AABB.
algo.mapUvOnCustomAABB(occurrences, aabb, uv3dSize=100, channel=0, overrideExistingUVs=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. AABB aabb Axis aligned bounding box to project on. Distance uv3dSize 3D size of the UV space [0-1]. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel.
See also:
mapUvOnCylinder
Generate texture coordinates using the projection on a cylinder.
algo.mapUvOnCylinder(occurrences, cylinder, channel=0, overrideExistingUVs=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Cylinder cylinder Cylinder definition. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel.
See also:
mapUvOnFittingCylinder
Generate texture coordinates using the projection on a fitting cylinder.
algo.mapUvOnFittingCylinder(occurrences, channel=0, overrideExistingUVs=True, useAABB=True, forcedAxis=geom.Vector3(0,0,0))
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel. Boolean useAABB If true use for the fitting the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). Vector3 forcedAxis Forced axis of the Cylinder.
See also:
mapUvOnFittingSphere
Generate texture coordinates using the projection on a fitting sphere.
algo.mapUvOnFittingSphere(occurrences, channel=0, overrideExistingUVs=True, useAABB=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel. Boolean useAABB If true use for the fitting the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB).
See also:
mapUvOnMBB
Generate texture coordinates using the projection on object Minimum Bounding Box.
algo.mapUvOnMBB(occurrences, useLocalMBB=False, uv3dSize=100, channel=0, overrideExistingUVs=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Bool useLocalMBB If enabled, uses part own bounding box, else use global one. Distance uv3dSize 3D size of the UV space [0-1]. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel.
See also:
mapUvOnPlane
Generate texture coordinates using the projection on a plane.
algo.mapUvOnPlane(occurrences, plane, channel=0, overrideExistingUVs=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Plane plane Plane definition. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel.
See also:
mapUvOnSphere
Generate texture coordinates using the projection on a sphere.
algo.mapUvOnSphere(occurrences, sphere, channel=0, overrideExistingUVs=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Sphere sphere Sphere definition. Int channel The UV channel which will contains the texture coordinates. Boolean overrideExistingUVs If True, override existing UVs on channel.
See also:
mergeUVIslandsAffine
Important
This function is tagged as experimental.
Minimizes the number of seams in the UV mapping by merging UV islands using affine transformation (recommanded for hard surfaces).
algo.mergeUVIslandsAffine(occurrences, channel=0, scaleWeights=0, maxScaleVariationFactor=1.2, curvatureWeights=-1, usePolygonsWeights=1, useVerticesWeights=-1, allowedTransformations=0, allowUVInversion=False, rotationStep=-1)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel UV channel to merge. Double scaleWeights Weight to assign to scale for the merging priority. Double maxScaleVariationFactor Maximum scaling factor allowed, -1 meaning no limits. Double curvatureWeights Weight to assign to curvature for the merging priority. Double usePolygonsWeights Use polygons weights to prioritize seams between polygons with less weight. The value represents the feature weight. Double useVerticesWeights Use vertices weights to prioritize seams where vertices with less weight. The value represents the feature weight. TransformationType allowedTransformations Allowed transformation: TRSOnly or TRS+Skew. Boolean allowUVInversion Allow merged UVs to be inverted. Angle rotationStep Constrains rotation steps to the specified angle (in degrees). If set to -1, allows free rotation.
See also:
mergeUVIslandsRelaxed
Minimizes the number of seams in the UV mapping by merging UV islands using local reparametrization near the UV seams (recommanded for organic surfaces).
algo.mergeUVIslandsRelaxed(occurrences, channel=0, targetIslandCount=0, energyThreshold=0.01, forceIsolatedFaces=True)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel UV channel to use. Int targetIslandCount Target number of islands (zero means the algorithm runs until no more merging is possible). Double energyThreshold Max energy allowed during local reparametrization. Boolean forceIsolatedFaces UV islands consisting in a single isolated face completely surrounded by another island are forced to be merged, without reparametrization.
See also:
normalizeUV
Normalize UVs to fit in the [0-1] uv space.
algo.normalizeUV(occurrences, sourceUVChannel=0, destinationUVChannel=-1, uniform=True, sharedUVSpace=True, ignoreNullIslands=False)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int sourceUVChannel UV Channel to normalize. Int destinationUVChannel UV channel to store the normalized UV (if -1, sourceUVChannel will be replaced). Boolean uniform If true, the scale will be uniform. Else UV can be deformed with a non-uniform scale. Boolean sharedUVSpace If true, all parts will be processed as if they were merged to avoid overlapping of their UV coordinates. Boolean ignoreNullIslands If true, islands with null height and width will be ignored and their UV coordinates will be set to [0,0] (Slower if enabled).
See also:
removeUV
Remove one or all UV channel(s).
algo.removeUV(occurrences, channel=-1)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel The UV channel to remove (all if channel=-1).
See also:
repackUV
Pack existing UV (create atlas).
algo.repackUV(occurrences, channel=0, shareMap=True, resolution=1024, padding=2, uniformRatio=False, iterations=3, removeOverlaps=True) -> scene.OccurrenceList
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int channel The UV channel to repack. Boolean shareMap If True, the UV of all given parts will be packed together. Int resolution Resolution wanted for the final map. UInt padding Set the padding (in pixels) between UV islands. Boolean uniformRatio If true, UV of different part will have the same ratio. Int iterations Fitting iterations. Boolean removeOverlaps Remove overlaps to avoid multiple triangles UVs to share the same pixel.
Returns
Type Name Description OccurrenceList failedParts Parts which failed to be repacked at this resolution (try to increase the resolution or decrease the padding).
See also:
resizeUVsToTextureSize
Rescale the UV coordinates to fit the input texture size.
algo.resizeUVsToTextureSize(occurrences, TextureSize=100, channel=0)
Parameters
Type Name Description OccurrenceList occurrences Occurrences to use for the rescaling. Distance TextureSize Texture size to use for the UV coordinates (in millimeters). Int channel UV channel to use.
See also:
scaleUV
Apply a scale on texture coordinates.
algo.scaleUV(occurrences, scaleU, scaleV, channel=0)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Double scaleU Scale to apply to U coordinate. Double scaleV Scale to apply to V coordinate. Int channel UV channel to transform.
See also:
swapUvChannels
Swap two UV channels.
algo.swapUvChannels(occurrences, firstChannel=0, secondChannel=0)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. Int firstChannel First UV Channel to swap. Int secondChannel Second UV Channel to swap.
See also:
unwrapUV
Important
This function is tagged as experimental.
Unwrap UV islands.
algo.unwrapUV(occurrences, method=0, channel=-1, createSeamsFromLoI=False, iterMax=50, tolerance=0.00001)
Parameters
Type Name Description OccurrenceList occurrences Part occurrences to process. UnwrapUVMethod method Minimization method to use for unwrapping (isometric or conformal). Int channel The UV channel which will contains the texture coordinates. Boolean createSeamsFromLoI Use Lines of Interest to generate UV islands. Int iterMax For iterative solvers: set the maximum number of iterations allowed. Double tolerance For iterative solvers: set the maximum error threshold.
See also:
fitting
getFittingCylinder
Returns the fitting cylinder of a set of occurrences (based on MBB).
algo.getFittingCylinder(occurrences, useAABB=True, forcedAxis=geom.Vector3(0,0,0)) -> geom.Affine
Parameters
Type Name Description OccurrenceList occurrences Occurrences to fit. Boolean useAABB If true use the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB). Vector3 forcedAxis Forced axis of the Cylinder when using MBB.
Returns
Type Name Description Affine affine Affine transformation of the cylinder.
See also:
getFittingSphere
Returns the fitting sphere of a set of occurrences.
algo.getFittingSphere(occurrences, useAABB=True) -> geom.Affine
Parameters
Type Name Description OccurrenceList occurrences Occurrences to fit. Boolean useAABB If true use the global Axis Aligned Bounding Box (AABB), else use a Minimum Bounding Box (MBB).
Returns
Type Name Description Affine affine Affine transformation of the sphere.
See also:
map_generation
convertNormalMap
Convert an existing normal map between Object-space and Tangent-space.
algo.convertNormalMap(partOccurrences, normalMap, uvChannel=0, sourceSpace=0, destinationSpace=2, sourceIsRightHanded=True, destinationIsRightHanded=True, replaceMap=True, resolution=-1, padding=1) -> material.Image
Parameters
Type Name Description OccurrenceList partOccurrences Occurrences of components using the given map. Image normalMap Source normal map to convert. Int uvChannel UV channel used on the given map. Space sourceSpace Defines the space (object, world or tangent) from which the given normalMap is converted. Space destinationSpace Defines the space (object, world or tangent) to which the given normalMap is converted. Boolean sourceIsRightHanded Considers source normal map as part of a right-handed coordinates system. Boolean destinationIsRightHanded Generate destination normal map as part of a right-handed coordinates system. Boolean replaceMap If true, the given normalMap will be replaced by the converted one. Int resolution New map resolution (if replaceMap=false), if resolution=-1, the input resolution will be used. Int padding Number 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
Type Name Description Image convertedNormalMap Converted normal map (equals normalMap if replaceMap=true).
See also:
createBillboard
Create a billboard imposter.
algo.createBillboard(occurrences, resolution=1024, XPositive=True, XNegative=True, YPositive=True, YNegative=True, ZPositive=True, ZNegative=True, moveFacesToCenter=True, leftHandedNormalMap=False) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Occurrences to bake in the billboard. Int resolution Total resolution of the billboard (contains all wanted faces). Bool XPositive Bake face facing X+. Bool XNegative Bake face facing X-. Bool YPositive Bake face facing Y+. Bool YNegative Bake face facing Y-. Bool ZPositive Bake face facing Z+. Bool ZNegative Bake face facing Z-. Bool moveFacesToCenter If true, all face are moved to the center of the AABB of the occurrences, else it will shape an AABB. Bool leftHandedNormalMap If true, a left handed normal map will be generated.
Returns
Type Name Description Occurrence billboard Resulting billboard.
See also:
fillNormalMap
Important
This function is tagged as experimental.
Fill normal map (useful after a decimation for example).
algo.fillNormalMap(normalMap)
Parameters
Type Name Description Image normalMap Source normal map to convert.
See also:
orientNormalMap
Important
This function is tagged as experimental.
Orient a tangent space normal map (all Z positive).
algo.orientNormalMap(normalMap)
Parameters
Type Name Description Image normalMap Normal map to orient.
See also:
repair
barySmooth
Smooth the tessellations by moving the vertices to the barycenter of their neighbors.
algo.barySmooth(occurrences, iteration=1)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Int iteration Number of iterations.
See also:
crackMoebiusStrips
Remove moebius strip by topologically cracking them (make it orientable).
algo.crackMoebiusStrips(occurrences, maxEdgeCount=3)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to repair. Int maxEdgeCount Maximum number of edges to crack to remove one moebius strip.
See also:
crackNonManifoldVertices
Splits non-manifold vertices.
algo.crackNonManifoldVertices(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to repair.
See also:
createCavityOccurrences
Identify cavities and create occurrences to show them.
algo.createCavityOccurrences(occurrences, voxelSize=100, minimumCavityVolume=1, mode=0, parent=None) -> scene.Occurrence
Parameters
Type Name Description OccurrenceList occurrences Occurrences set to identify cavities. Distance voxelSize Size of the voxels in mm. Volume minimumCavityVolume Minimum volume of a cavity in cubic meter. InnerOuterOption mode Select where to place camera (all cavities, only outer or only inner cavities). Occurrence parent The create occurrence root will be added under the parent if given, else it will be added under the deeper parent of given occurrences.
Returns
Type Name Description Occurrence root Parent occurrence of the cavity occurrences.
See also:
invertPolygonFacesOrientation
Invert the orientation of tessellation elements.
algo.invertPolygonFacesOrientation(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
See also:
moebiusCracker
Splits moebius ring.
algo.moebiusCracker(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to repair.
See also:
orientNormals
Orient existing normal according to the polygons clockwise.
algo.orientNormals(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to orient normals.
See also:
remeshSurfacicHoles
Important
This function is tagged as experimental.
Resmesh surfacic holes of tessellations.
algo.remeshSurfacicHoles(occurrences, maxDiameter=0, refine=True, numberOfNeighbors=3, fillWithMaterial=0)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Distance maxDiameter Maximum surfacic holes diameters. Boolean refine Refine mesh for more details in holes. Int numberOfNeighbors Number of neighboring vertices to use for the MLS projection. Material fillWithMaterial If set, the given material will be used to fill the holes.
See also:
removeDegeneratedPolygons
Remove some kinds of degenerated polygons.
algo.removeDegeneratedPolygons(occurrences, tolerance=0.1)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Distance tolerance Degenerated tolerance.
See also:
removeMultiplePolygon
Remove multiple polygon.
algo.removeMultiplePolygon(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to repair.
See also:
removeZFighting
Remove Z-fighting (surfaces overlapping) by slightly shrinking the selected parts' surfaces.
algo.removeZFighting(occurrences) -> geom.Distance
Parameters
Returns
Type Name Description Distance offset Offset value used by the algorithm.
See also:
repairMesh
Launch the repair process to repair a disconnected or not clean tessellation.
algo.repairMesh(occurrences, tolerance=0.1, crackNonManifold=True, orient=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Distance tolerance Connection tolerance. Bool crackNonManifold At the end of the repair process, crack resulting non-manifold edges. Boolean orient If true reorient the model.
See also:
repairNullNormals
Create normal on an existing normal set when normal is null (polygons appears black).
algo.repairNullNormals(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to repair null normals.
See also:
separateToManifold
Important
This function is tagged as experimental.
Remove non manifold edges and try to reconnect manifold groups of triangles.
algo.separateToManifold(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
See also:
sewBoundary
Sew boundaries between them.
algo.sewBoundary(occurrences, maxDistance)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to repair. Distance maxDistance Maximum distance between bundaries.
See also:
vertexOffset
Move the vertices by the offsset along their normal.
algo.vertexOffset(occurrences, offset=1)
Parameters
See also:
repair faces orientation
orientFromFace
Orient all connected polygons in the same orientation of the polygon selectionned.
See also:
orientPolygonFaces
Orient tessellation elements.
algo.orientPolygonFaces(occurrences, makeOrientable=True, useArea=False, orientStrategy=0)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Boolean makeOrientable Crack moebius strips to make the model orientable. Boolean useArea Use the area instead of counting the number of triangle. OrientStrategy orientStrategy Strategy to adopt with this algorithm.
See also:
orientPolygonFacesAdvanced
Properly orient all polygons in the same direction, using voxel based view points placement.
algo.orientPolygonFacesAdvanced(occurrences, voxelSize=100, minimumCavityVolume=1, resolution=64, mode=0, considerTransparentOpaque=True, orientStrategy=0)
Parameters
Type Name Description OccurrenceList occurrences Occurrences to orient. Distance voxelSize Size of the voxels in mm (smaller it is, more viewpoints there are). Volume minimumCavityVolume Minimum volume of a cavity in cubic meter (smaller it is, more viewpoints there are). Int resolution Resolution of the visibility viewer. InnerOuterOption mode Select where to place camera (all cavities, only outer or only inner cavities). Boolean considerTransparentOpaque If True, Parts, Patches or Polygons with a transparent appearance are considered as opaque. OrientStrategyAdvanced orientStrategy Strategy to adopt with this algorithm.
See also:
orientPolygonFacesFromCamera
Properly orient all polygons in the same direction, using a specified viewpoint.
algo.orientPolygonFacesFromCamera(occurrences, cameraPosition, cameraDirection, cameraUp, resolution=1024, fovX=90)
Parameters
Type Name Description OccurrenceList occurrences Occurrences to orient. Point3 cameraPosition Camera position. Point3 cameraDirection Camera direction. Point3 cameraUp Camera up vector. Int resolution Resolution of the visibility viewer. Double fovX Horizontal field of view (in degree).
See also:
tessellation conversion
equilateralize
Sswap edges to make triangles more equilateral.
algo.equilateralize(occurrences, maxIterations=1)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Int maxIterations Maximum number of swapping iteration.
See also:
quadify
Merge all triangle polygons in the meshes to quadrangles.
algo.quadify(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
See also:
requadify
Advanced function to requadify a triangle tessellation coming from full quad mesh.
algo.requadify(occurrences, forceFullQuad=True)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Bool forceFullQuad Force the results to be only full quad. It it's impossible, nothing is done.
See also:
triangularize
Split all non-triangle polygons in the meshes to triangles.
algo.triangularize(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
See also:
vertex weights
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.
algo.createVertexWeightsFromVertexColors(occurrences, offset=0, scale=1)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Double offset Offset value for weight computation. Double scale Scale value for weight computation.
See also:
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.
algo.createVertexWeightsFromVisibilityAttributes(occurrences, offset=0, scale=1)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process. Double offset Offset value for weight computation. Double scale Scale value for weight computation.
See also:
deleteVertexWeights
Remove any existing vertex weights attributes on given occurrences.
algo.deleteVertexWeights(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to process.
See also:
visibility
createVisibilityAttributes
Create visibility attributes on tessellations.
algo.createVisibilityAttributes(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to create attributes.
See also:
deletePolygonalWeightAttribute
Important
This function is tagged as experimental.
Delete Polygonal Weight attributes on tessellations.
algo.deletePolygonalWeightAttribute(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to delete attributes.
See also:
deleteVisibilityAttributes
Delete visibility attributes on tessellations.
algo.deleteVisibilityAttributes(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to delete attributes.
See also:
flagVisibilityAttributesOnTransparents
Add one count to all visiblility attributes (poly and patch) on transparent patches.
algo.flagVisibilityAttributesOnTransparents(occurrences)
Parameters
Type Name Description OccurrenceList occurrences Occurrences of components to create attributes.
See also:
transferVisibilityToPolygonalWeight
Important
This function is tagged as experimental.
Set Polygonal Weight Attribute from Visibility Attribute.
algo.transferVisibilityToPolygonalWeight(occurrences, Mode=0)
Parameters
See also: