PolygonMesh (object)

A PolygonMesh is a geometry made of a collection of polygons connected points. Attributes values, such as UVs and normals, can be attached to the points, and these are contained in a GeometryAttributes container. The PolygonMesh supports spatial queries such as raycast by implementing the SpatialQueryable interface.

注釈

Unless stated otherwise, functions that read the mesh are threadsafe only if the mesh structure or attribute sharing layout is not modified. Functions that modify the mesh structure or the attribute sharing layout are not threadsafe.

Please refer to the following guide for an in-depth description of the mesh structure, components and attributes:

PolygonMesh PolygonMesh PolygonMesh BaseGeometry BaseGeometry PolygonMesh->BaseGeometry Geometry Geometry PolygonMesh->Geometry GeometryAttributesOwnerCallbacks GeometryAttributesOwnerCallbacks PolygonMesh->GeometryAttributesOwnerCallbacks SpatialQueryable SpatialQueryable PolygonMesh->SpatialQueryable StatisticSourceWithAutoRegisterMember StatisticSourceWithAutoRegisterMember BaseGeometry->StatisticSourceWithAutoRegisterMember ThreadsafeMetaDataOwner ThreadsafeMetaDataOwner BaseGeometry->ThreadsafeMetaDataOwner Versioned Versioned BaseGeometry->Versioned

Members

GeometryAttributes attributes Container for all attributes.
String debugName Name that will be printed in descriptions.
UInt32 structureVersion Version of the geometry structure itself, excluding the GeometryAttributes content.
Boolean computeGPUBoundingVolume If positions are on the GPU: if true, the bounding volume is computed, else an infinite bbox is returned.
ThreadsafeMetaDataContainer metaData Container for holding various user data (Geometry specific), such as the BoundingBox cache data, or raycast acceleration structures and data (Octree).
PolygonMeshTopology topology  
UInt32 memType  
UInt32 attributeSharingVersion This version is automatically incremented when attribute sharing layout changes
Boolean maintainOrderedPointPolygons If this is false, pointPolygons will not be reordered. This will increase performance if the mesh only needs to hold data with no need to query the structure.
/*
** Example: PolygonMesh
*/

require Geometry;
  
operator entry() {

          // create a simple polygon mesh
          PolygonMesh mesh();
          
          // begin changes before adding polygons
          mesh.beginStructureChanges();
          
          // create points and set their positions
          Size firstPoint = mesh.createPoints(4);
          mesh.setPointPosition( 0, Vec3( 0, 0, 0) );
          mesh.setPointPosition( 1, Vec3( 1, 0, 0) );
          mesh.setPointPosition( 2, Vec3( 0, 0, 1) );
          mesh.setPointPosition( 3, Vec3( 1, 0, 1) );
          
          // create a quad
          mesh.addPolygon( 0, 2, 3, 1 );
          
          // end changes bracket (batch update pointPolygons order)
          mesh.endStructureChanges();
          
          // generate default normals
          mesh.recomputePointNormals();
          
          // print the resulting structure
          for( Size i = 0; i < mesh.polygonCount(); ++i ) {
            report("Polygon " + i + ":");
            for( Size j = 0; j < mesh.getPolygonSize(i); ++j ) {
              UInt32 point = mesh.getPolygonPoint( i, j );
              report( "  Point " + point 
                    + ": pos=" + mesh.getPointPosition(point) 
                    + " normal=" + mesh.getPointNormal(point) );
            }
          }
  
}

/*
** Output:

Polygon 0:
  Point 0: pos={x:+0.0,y:+0.0,z:+0.0} normal={x:+0.0,y:+1.0,z:+0.0}
  Point 2: pos={x:+0.0,y:+0.0,z:+1.0} normal={x:+0.0,y:+1.0,z:+0.0}
  Point 3: pos={x:+1.0,y:+0.0,z:+1.0} normal={x:+0.0,y:+1.0,z:+0.0}
  Point 1: pos={x:+1.0,y:+0.0,z:+0.0} normal={x:+0.0,y:+1.0,z:+0.0}

*/

Methods

  PolygonMesh ( in Boolean float64Positions )
  PolygonMesh ( in PolygonMesh other )
  PolygonMesh ( in String debugName )
  PolygonMesh ( in String debugName, in Boolean float64Positions )
  PolygonMesh ()
UInt32 addNoneOverlappingUVLayout ! ( in String attributeName, in Boolean fixedResolution, in UInt32 resolution, in Float32 pixelsPerSquare, in UInt32 maxResolution, in UInt32 margin, in Float32 smoothStrength, in UInt32 smoothIterations )
UInt32 addUniqueUVAttribute ! ( in String attributeName, in Boolean fixedResolution, in UInt32 resolution, in Float32 pixelsPerSquare, in UInt32 maxResolution )
  applyTransform ! ( in Mat44 transform )
  applyTransform ! ( in Xfo transform )
Boolean areGeometryLocationsEquivalent ? ( in GeometryLocation location0, in GeometryLocation location1 )
  clear ! ()
PolygonMesh clone ? ()
  cloneMembersTo ? ( io PolygonMesh that )
Boolean cloneUVs ? ( in String source, in String target )
  convertToCPU ! ()
  convertToGPU ! ()
  copy ! ( in Geometry src )
  copy ! ( in PolygonMesh src )
Size createPoints ! ( in Size nb )
  deleteUnusedPoints ! ()
Size elementCount ? ()
Vec3[] getAllPointPositions ? ()
LocalBoundingVolume getBoundingVolume ? ()
UInt32 getClosestEdgeToLocation ? ( in GeometryLocation location, out Scalar weight )
String getDebugName ? ()
LocalBoundingVolume getElementBoundingVolume ? ( in Size index )
  getLocationAttributeIndicesAndWeights ? ( in GeometryLocation location, out LocalL16UInt32Array attributeIndices, out LocalL16ScalarArray weights )
UInt32 getMemType ? ()
Ref<ThreadsafeMetaDataContainer> getMetaData ? ()
UInt32 getPointIterNextOffInWingInternal ? ( in DataIter pointIter, in UInt32 offset, in UInt32 nextOffset, in Size count, in DataIter borderDataIter )
Float32 getPolygonArea ? ( in Index polygon )
Size getPolygonPoint ? ( in Size polygon, in Size polygonPointIndex )
  getPolygonPointAndNeighborIndex ? ( in Size polygon, in Size polygonPointIndex, out Size point, out Size pointNeighborIndex )
Size getPolygonPointIndex ? ( in Size polygon, in Size point )
  getPolygonPoints ? ( in Size polygon, out LocalL8UInt32Array points )
  getPolygonPointsAndNeighborIndices ? ( in Size polygon, out LocalL8UInt32Array points, out LocalIndexArray polygonPointIndices )
Float32 getPolygonUVArea ? ( in Index polygon )
Float32 getPolygonUVArea ? ( in Index polygon, in String attributeName )
UInt32 getStructureVersion ? ()
UInt32 getVersion ? ()
Boolean hasFloat64Positions ? ()
  incrementPointPositionsVersion ! ()
Boolean isLocationInternalEdge ? ( in GeometryLocation location, in Index edge )
Boolean mapMaterialIDs ! ( in SInt32 newIDs<> )
Size nextPolygonPointIndex ? ( in Size polygon, in Size polygonPointIndex )
Size previousPolygonPointIndex ? ( in Size polygon, in Size polygonPointIndex )
  setAllPointPositions ! ( in Vec3 positions[] )
  setMaterialIDOnAllPolygons ! ( in SInt32 id )

ImportExportHelpers methods

  generateAttributesTriangleListAsExternalArray ? ( io UInt32 triangles<> )
  getColorAsExternalArrayForTriangle ? ( io Float32 values<> )
  getColorAttributeAsExternalArray ? ( io Float32 values<>, in String attributeName, in Size components )
Boolean getMeshExternalArrayForArnold ? ( io Xfo meshXfo, io Boolean hasuv, io UInt32 nsides<>, io UInt32 vidxs<>, io UInt32 nidxs<>, io UInt32 uvidxs<>, io Float32 nlist<>, io Float32 vlist<>, io Float32 uvlist<> )
  getNormalAsExternalArrayForTriangle ? ( io Float32 values<> )
  getNormalsAsExternalArray ? ( io Float32 values<> )
  getNormalsAsExternalArray_d ? ( io Float64 values<> )
Size getNormalsAttributeSize ? ()
  getPointsAsExternalArray ? ( io Float32 values<>, in Size components )
  getPointsAsExternalArray_d ? ( io Float64 values<>, in Size components )
  getPositionsAsExternalArrayForTriangle ? ( io Float32 values<> )
Size getPositionsAttributeSize ? ()
  getScalarAttributeAsExternalArray ? ( io Float32 values<>, in String attributeName, in Size components )
  getSkinningAttributeAsExternalArray ? ( io Float32 values<>, in String attributeName, in Size bones )
  getTopologyAsCombinedExternalArray ? ( io UInt32 indices<> )
  getTopologyAsCountsIndicesExternalArrays ? ( io UInt32 counts<>, io UInt32 indices<> )
  getTopologyCountsAndAttributeIndices ? ( out UInt32 nsides[], out UInt32 attr_idxs[] )
  getUVAsExternalArrayForTriangle ? ( io Float32 values<> )
Size getUVAttributeSize ? ()
  getUVsAsExternalArray ? ( io Float32 values<>, in Size components )
Vec2[] getUVsAsPackedArray ? ( io UInt32 polygonPackedIndices[] )
  getVec2AttributeAsExternalArray ? ( io Float32 values<>, in String attributeName, in Size components )
  getVec3AttributeAsExternalArray ? ( io Float32 values<>, in String attributeName, in Size components )
Size getVertexColorAttributeSize ? ()
  getVertexColorsAsExternalArray ? ( io Float32 values<>, in Size components )
Boolean hasUVs ? ()
Boolean hasVertexColors ? ()
  setColorAttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size components )
  setColorPointAttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size components )
  setNormalsFromExternalArray ! ( in Float32 values<> )
  setNormalsFromExternalArray_d ! ( in Float64 values<> )
  setPointsFromExternalArray ! ( in Float32 values<>, in Size components )
  setPointsFromExternalArray_d ! ( in Float64 values<>, in Size components )
  setScalarAttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size components )
  setScalarPointAttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size components )
  setSkinningAttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size bones )
  setSkinningPointAttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size bones )
  setTopologyFromCombinedExternalArray ! ( in UInt32 indices<> )
  setTopologyFromCountsIndicesExternalArrays ! ( in UInt32 counts<>, in UInt32 indices<> )
  setUVsFromExternalArray ! ( in Float32 values<>, in Size components )
  setVec2AttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size components )
  setVec2PointAttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size components )
  setVec3AttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size components )
  setVec3PointAttributeFromExternalArray ! ( in Float32 values<>, in String attributeName, in Size components )
  setVertexColorsFromExternalArray ! ( in Float32 values<>, in Size components )

SpatialQueryable methods

Ref<SpatialQuery> beginSpatialQuery ? ()
  endSpatialQuery ? ( in Ref<SpatialQuery> query )
GeometryLocation getClosest ? ( in Vec3 position, in Vec3 scaling, in Scalar maxUnscaledDistance )
  getLocationAttributeIndicesAndWeights ? ( in GeometryLocation location, out UInt32 attributeIndices[3], out Scalar weights[3] )
  getLocationPointsAndWeights ? ( in GeometryLocation location, out UInt32 points[3], out Scalar weights[3] )
Size getLocationPolygon ? ( in GeometryLocation location )
  getLocationPolygonPointIndicesAndWeights ? ( in GeometryLocation location, out UInt32 polygonPointIndices[3], out Scalar weights[3] )
Vec3 getNormalAtLocation ? ( in GeometryLocation location )
Vec3 getPositionAtLocation ? ( in GeometryLocation location )
Vec3_d getPositionAtLocation_d ? ( in GeometryLocation location )
  prepareForSpatialQueries ? ( in Size approximateNumberOfQueries, in GenericValueContainer options )
GeometryLocation raycast ? ( in Ray ray, in Boolean doubleSided, in Scalar coneThreshold, in Scalar maxDistance )
  removeSpatialQueryAcceleration ! ()

Attributes methods

Boolean arePointAttributesUniform ? ( in Size point )
Boolean arePointIterAttributesUniform ? ( in DataIter pointIter )
Boolean arePolygonAttributeUniformForAllCorners ? ( in Size polygon )
Ref<GeometryAttribute> getAttribute ? ( in String name )
Ref<GeometryAttribute> getAttribute ? ( in String name, in Type attributeType )
Ref<GeometryAttributes> getAttributes ? ()
Ref<GeometryAttribute> getOrCreateAttribute ! ( in String name, in Type attributeType )
Ref<ColorAttribute> getOrCreateColorAttribute ! ( in String name )
Ref<IntegerAttribute> getOrCreateIntegerAttribute ! ( in String name )
Ref<Mat33Attribute> getOrCreateMat33Attribute ! ( in String name )
Ref<Mat44Attribute> getOrCreateMat44Attribute ! ( in String name )
Ref<QuatAttribute> getOrCreateQuatAttribute ! ( in String name )
Ref<RGBAAttribute> getOrCreateRGBAAttribute ! ( in String name )
Ref<RGBAttribute> getOrCreateRGBAttribute ! ( in String name )
Ref<ScalarAttribute> getOrCreateScalarAttribute ! ( in String name )
Ref<ScalarConstantArrayAttribute> getOrCreateScalarConstantArrayAttribute ! ( in String name )
Ref<SkinningAttribute> getOrCreateSkinningAttribute ! ( in String name )
Ref<UInt16ConstantArrayAttribute> getOrCreateUInt16ConstantArrayAttribute ! ( in String name )
Ref<UInt32Attribute> getOrCreateUInt32Attribute ! ( in String name )
Ref<Vec2Attribute> getOrCreateVec2Attribute ! ( in String name )
Ref<Vec3Attribute> getOrCreateVec3Attribute ! ( in String name )
Ref<Vec3_dAttribute> getOrCreateVec3_dAttribute ! ( in String name )
Ref<Vec4Attribute> getOrCreateVec4Attribute ! ( in String name )
Size getPointAttributeIndex ? ( in Size point )
Size getPointAttributeIndex ? ( in Size point, in Size neighborPolygonIndex )
Size getPointFromAttributeIndex ? ( in Size attributeIndex )
Size getPolygonAttributeIndex ? ( in Size polygon, in Size polygonPointIndex )
  getPolygonPackedSharedAttributeValues ? ( in Ref<GeometryAttribute> meshAttribute, io GeometryAttribute outValues, io UInt32 polygonPackedIndices[] )
Boolean has ? ( in String name )
Boolean hasAttribute ? ( in String name )
Boolean isPointAttributeUniform ? ( in Size point, in Ref<GeometryAttribute> attribute )
Boolean isPolygonAttributeUniformForAllCorners ? ( in Size polygon, in Ref<GeometryAttribute> attribute )
  removeAttribute ! ( in String name )
  resetAttributeAndAvoidSharingChanges ! ( in Ref<GeometryAttribute> attribute )
  setAttributeFromPolygonPackedData ! ( in String name, in Color values<> )
  setAttributeFromPolygonPackedData ! ( in String name, in Color values<>, in Size optionalValuesIndices[] )
  setAttributeFromPolygonPackedData ! ( in String name, in RGB values<> )
  setAttributeFromPolygonPackedData ! ( in String name, in RGB values<>, in Size optionalValuesIndices[] )
  setAttributeFromPolygonPackedData ! ( in String name, in RGBA values<> )
  setAttributeFromPolygonPackedData ! ( in String name, in RGBA values<>, in Size optionalValuesIndices[] )
  setAttributeFromPolygonPackedData ! ( in String name, in Scalar values<> )
  setAttributeFromPolygonPackedData ! ( in String name, in Scalar values<>, in Size optionalValuesIndices[] )
  setAttributeFromPolygonPackedData ! ( in String name, in Vec2 values<> )
  setAttributeFromPolygonPackedData ! ( in String name, in Vec2 values<>, in Size optionalValuesIndices[] )
  setAttributeFromPolygonPackedData ! ( in String name, in Vec3 values<> )
  setAttributeFromPolygonPackedData ! ( in String name, in Vec3 values<>, in Size optionalValuesIndices[] )
  setAttributeFromPolygonPackedData ! ( in String name, in Vec4 values<> )
  setAttributeFromPolygonPackedData ! ( in String name, in Vec4 values<>, in Size optionalValuesIndices[] )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<ColorAttribute> attribute, in Color value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<Mat33Attribute> attribute, in Mat33 value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<Mat44Attribute> attribute, in Mat44 value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<QuatAttribute> attribute, in Quat value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<RGBAAttribute> attribute, in RGBA value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<RGBAttribute> attribute, in RGB value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<ScalarConstantArrayAttribute> attribute, in LocalL16ScalarArray value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<UInt16ConstantArrayAttribute> attribute, in LocalL16UInt16Array value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<UInt32Attribute> attribute, in UInt32 value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<Vec2Attribute> attribute, in Vec2 value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<Vec3Attribute> attribute, in Vec3 value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<Vec3_dAttribute> attribute, in Vec3_d value )
  setPointAttribute ! ( in Size point, in Size neighborPolygonIndex, io Ref<Vec4Attribute> attribute, in Vec4 value )
  setPointAttribute ! ( in Size point, io Ref<ColorAttribute> attribute, in Color value )
  setPointAttribute ! ( in Size point, io Ref<IntegerAttribute> attribute, in Integer value )
  setPointAttribute ! ( in Size point, io Ref<Mat33Attribute> attribute, in Mat33 value )
  setPointAttribute ! ( in Size point, io Ref<Mat44Attribute> attribute, in Mat44 value )
  setPointAttribute ! ( in Size point, io Ref<QuatAttribute> attribute, in Quat value )
  setPointAttribute ! ( in Size point, io Ref<RGBAAttribute> attribute, in RGBA value )
  setPointAttribute ! ( in Size point, io Ref<RGBAttribute> attribute, in RGB value )
  setPointAttribute ! ( in Size point, io Ref<ScalarAttribute> attribute, in Scalar value )
  setPointAttribute ! ( in Size point, io Ref<ScalarConstantArrayAttribute> attribute, in LocalL16ScalarArray value )
  setPointAttribute ! ( in Size point, io Ref<SkinningAttribute> attribute, in LocalL16UInt32Array indices, in LocalL16ScalarArray weights )
  setPointAttribute ! ( in Size point, io Ref<UInt16ConstantArrayAttribute> attribute, in LocalL16UInt16Array value )
  setPointAttribute ! ( in Size point, io Ref<UInt32Attribute> attribute, in UInt32 value )
  setPointAttribute ! ( in Size point, io Ref<Vec2Attribute> attribute, in Vec2 value )
  setPointAttribute ! ( in Size point, io Ref<Vec3Attribute> attribute, in Vec3 value )
  setPointAttribute ! ( in Size point, io Ref<Vec3_dAttribute> attribute, in Vec3_d value )
  setPointAttribute ! ( in Size point, io Ref<Vec4Attribute> attribute, in Vec4 value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<ColorAttribute> attribute, in Color value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<IntegerAttribute> attribute, in Integer value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<Mat33Attribute> attribute, in Mat33 value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<Mat44Attribute> attribute, in Mat44 value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<QuatAttribute> attribute, in Quat value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<RGBAAttribute> attribute, in RGBA value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<RGBAttribute> attribute, in RGB value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<ScalarAttribute> attribute, in Scalar value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<ScalarConstantArrayAttribute> attribute, in LocalL16ScalarArray value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<SkinningAttribute> attribute, in LocalL16UInt32Array indices, in LocalL16ScalarArray weights )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<UInt16ConstantArrayAttribute> attribute, in LocalL16UInt16Array value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<UInt32Attribute> attribute, in UInt32 value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<Vec2Attribute> attribute, in Vec2 value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<Vec3Attribute> attribute, in Vec3 value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<Vec3_dAttribute> attribute, in Vec3_d value )
  setPolygonAttribute ! ( in Size polygon, in Size polygonPointIndex, io Ref<Vec4Attribute> attribute, in Vec4 value )

Debugging methods

  _validate ! ()
String getDesc ? ( in Boolean withAttributes )
String getDesc ? ( in Boolean withAttributes, in Boolean useUnitTestPrint )

Edge methods

Size getEdgeFirstPoint ? ( in PolygonMeshEdge edge )
PolygonMeshEdge getEdgeFromPoints ? ( in Size point1, in Size point2 )
Size getEdgeLeftPolygon ? ( in PolygonMeshEdge edge )
Size getEdgeRightPolygon ? ( in PolygonMeshEdge edge )
Size getEdgeSecondPoint ? ( in PolygonMeshEdge edge )
PolygonMeshEdge getPointEdge ? ( in Size point, in Size pointEdgeIndex )
Size getPointEdgeCount ? ( in Size point )
PolygonMeshEdge getPolygonEdge ? ( in Size polygon, in Size polygonPointIndex )

Modeling methods

Size _addPolygon ! ( in LocalL8UInt32Array points, in Boolean updateStructure )
  addExtrusion ! ( in Xfo xfos[], in Vec3 profile[] )
  addExtrusion ! ( in Xfo xfos[], in Vec3 profile[], in Boolean close )
Size addPolygon ! ( in LocalL8UInt32Array points )
Size addPolygon ! ( in Size ptIdx1, in Size ptIdx2, in Size ptIdx3 )
Size addPolygon ! ( in Size ptIdx1, in Size ptIdx2, in Size ptIdx3, in Size ptIdx4 )
Size addPolygonAndUpdateStructure ! ( in LocalL8UInt32Array points )
Size addPolygonAndUpdateStructure ! ( in Size ptIdx1, in Size ptIdx2, in Size ptIdx3 )
Size addPolygonAndUpdateStructure ! ( in Size ptIdx1, in Size ptIdx2, in Size ptIdx3, in Size ptIdx4 )
  addPolygons ! ( in Size polygonSizes<>, in Size packedPolygonPointIndices<> )
  addRevolution ! ( in Xfo xfo, in Vec3 profile[], in Vec3 center, in Vec3 axis, in Size detail )
  addRevolution ! ( in Xfo xfo, in Vec3 profile[], in Vec3 center, in Vec3 axis, in Size detail, in Vec2 range, in Boolean close )
  addShell ! ( in Scalar thickness )
  beginStructureChanges ! ()
  deletePolygon ! ( in Size polygonIndex, in Boolean deleteUnusedPoints, in Boolean reorderPoints )
  endStructureChanges ! ()
  extrudeLines ! ( in Lines lines, in UInt32 subdiv, in Scalar thickness, in Vec3 upvector, out Xfo transforms[] )
  invertPolygon ! ( in Size polygonIndex )
  invertPolygons ! ()
Boolean isPointDeleted ? ( in Size point )
Boolean isPolygonDeleted ? ( in Size polygon )
  linearSubdividePolygons ! ( in Size polygons[], io Size firstEdgePoint, io Size firstCenterPoint )
  mergeMesh ! ( in Ref<PolygonMesh> source )
  mergeMeshClones ! ( in Ref<PolygonMesh> source, in Xfo transformXfos[], in Boolean transformNormals )
  mergeMeshes ! ( in PolygonMesh sources[], in Xfo transformXfos[], in Boolean transformNormals )
  mergeMeshes ! ( in PolygonMesh sources[], in Xfo transformXfos[], in Boolean transformNormals, in Boolean setupMaterialIDs )
  mergeMeshes ! ( in PolygonMesh sources[], io Size firstPoints[], io Size firstPolygons[] )
  mergePoints ! ( in Size firstPointToDelete, in Size secondPoint, in Scalar attributeFirstToSecondRatio, in Boolean deleteOtherUnusedPoints, in Boolean reorderPoints )
  splitEdge ! ( in PolygonMeshEdge edge, in Scalar attributeSplitRatio, out Size newPointIndex, out PolygonMeshEdge newEdge )
Size splitEdge ! ( in Size polygon, in Size polygonPointIndex, in Scalar attributeSplitRatio )
PolygonMesh[] splitMeshIntoChunks ? ( in UInt32 chunkSizeLimit )
  splitPolygon ! ( in Size polygon, in Size polygonPointIndex1, in Size polygonPointIndex2, out Size newPolygon, out Size newPolygonEdgeStartPointIndex )
  splitPolygon ! ( in Size polygonIndex, in Size point1, in Size point2, out Size newPolygonIndex, out PolygonMeshEdge newEdge )
  updatePointPolygonOrder ! ( in Size point )
  updatePointsPolygonOrder ! ()

Normals methods

Vec3 generatePolygonNormal ? ( in Size polygon )
Ref<Vec3Attribute> getNormals ? ()
Ref<Vec3Attribute> getOrCreateNormals ! ()
Vec3 getPointNormal ? ( in Size point )
Vec3 getPointNormal ? ( in Size point, in Size neighborPolygonIndex )
Vec3 getPolygonPointNormal ? ( in Size polygon, in Size polygonPointIndex )
  incrementNormalsVersion ! ()
  recomputePointNormals ! ( in Scalar hardAngleRadians )
  recomputePointNormals ! ()
  recomputePointNormalsIfRequired ! ( in Scalar hardAngleRadians )
  recomputePointNormalsIfRequired ! ()
  setPointNormal ! ( in Size point, in Size neighborPolygonIndex, in Vec3 normal )
  setPointNormal ! ( in Size point, in Vec3 normal )
  setPolygonPointNormal ! ( in Size polygon, in Size polygonPointIndex, in Vec3 normal )

Point methods

  getPointBorderInfo ? ( in Size point, in Size neighborPolygonIndex, out Boolean precededByBorder, out Boolean atClosedWingStart )
Size getPointNextNeighborPolygonIndexInWing ? ( in Size point, in Size neighborPolygonIndex )
Size getPointPolygon ? ( in Size point, in Size neighborPolygonIndex )
  getPointPolygonAndIndex ? ( in Size point, in Size neighborPolygonIndex, out Size polygon, out Size polygonPointIndex )
Size getPointPolygonCount ? ( in Size point )
  getPointPolygonFullBorderInfo ? ( in Size point, in Size neighborPolygonIndex, out Size wingPolygonPointIndexBegin, out Size wingPolygonPointIndexEnd, out Boolean isClosedWing )
  getPointPolygons ? ( in Size point, out LocalL8UInt32Array polygons )
  getPointPolygonsAndIndices ? ( in Size point, out LocalL8UInt32Array polygons, out LocalL8UInt32Array polygonPointIndices )
  getPointPolygonsBorderInfo ! ( in Size point, out LocalL8UInt32Array neighborPolygonsInfo )
Vec3 getPointPosition ? ( in Size point )
Vec3_d getPointPosition_d ? ( in Size point )
Size getPointPrevNeighborPolygonIndexInWing ? ( in Size point, in Size neighborPolygonIndex )
  getPointSurroundingPoints ? ( in Size point, in Boolean includeAllPolygonPoints, out LocalL16UInt32Array surroundingPoints )
Size pointCount ? ()
  setPointPosition ! ( in Size point, in Vec3 value )
  setPointPosition ! ( in Size point, in Vec3_d value )

Polygon methods

LocalBoundingVolume computePolygonBBox ? ( in Size polygon )
Size getPolygonAdjacentPolygon ? ( in Size polygon, in Size polygonPointIndex )
  getPolygonAdjacentPolygonAndIndex ? ( in Size polygon, in Size polygonPointIndex, io Size adjacentPolygon, io Size adjacentPolygonPointIndex )
Size getPolygonSize ? ( in Size polygon )
Boolean isPolygonBorder ? ( in Size polygon, in Size polygonPointIndex )
Size polygonCount ? ()
Size polygonPointsCount ? ()

Primitives methods

  addCone ! ( in Xfo xfo, in Scalar radius, in Scalar height, in Boolean cap, in Size detail )
  addCone ! ( in Xfo xfo, in Scalar radius, in Scalar height, in Boolean cap, in Size detail, in Boolean setNormals, in Boolean setUVs )
  addCube ! ( in Xfo xfo, in Scalar x, in Scalar y, in Scalar z )
  addCuboid ! ( in Xfo xfo, in Scalar x, in Scalar y, in Scalar z )
  addCuboid ! ( in Xfo xfo, in Scalar x, in Scalar y, in Scalar z, in Boolean setNormals, in Boolean setUVs )
  addCylinder ! ( in Xfo xfo, in Scalar radius, in Scalar height, in Boolean caps, in Integer sides, in Integer loops )
  addCylinder ! ( in Xfo xfo, in Scalar radius, in Scalar height, in Boolean caps, in Integer sides, in Integer loops, in Boolean setNormals, in Boolean setUVs )
  addDisc ! ( in Xfo xfo, in Scalar radius, in Scalar arcAngle, in Size detail, in Boolean setNormals, in Boolean setUVs )
  addPlane ! ( in Xfo xfo, in Scalar length, in Scalar width, in Size lengthSections, in Size widthSections )
  addPlane ! ( in Xfo xfo, in Scalar length, in Scalar width, in Size lengthSections, in Size widthSections, in Boolean setNormals, in Boolean setUVs )
  addSphere ! ( in Xfo xfo, in Scalar radius, in Size detail )
  addSphere ! ( in Xfo xfo, in Scalar radius, in UInt32 detail, in Boolean setNormals, in Boolean setUVs )
  addSphere ! ( in Xfo xfo, in Scalar radius, in UInt32 loops, in UInt32 sides, in Boolean setNormals, in Boolean setUVs )
  addTeapot ! ( in Xfo xfo, in Scalar size, in Integer detail )
  addTorus ! ( in Xfo xfo, in Scalar innerRadius, in Scalar outerRadius, in Size detail )
  addTorus ! ( in Xfo xfo, in Scalar innerRadius, in Scalar outerRadius, in Size detail, in Boolean setNormals, in Boolean setUVs )
  drawBone ! ( in Xfo xfo, in Scalar length, in Scalar radius, in Boolean setNormals )

Tangents methods

  recomputeTangents ! ()
  recomputeTangentsIfRequired ! ()

Triangles methods

UInt32[] generateAttributesTriangleList ? ()
UInt32[] generateTriangleList ? ()
Size getPolygonSubTriangleCount ? ( in Size polygon )
UInt32[3] getPolygonSubTrianglePolygonPoints ? ( in Size polygon, in Size subTriangleIndex )
Size triangleCount ? ()

Methods in detail

PolygonMesh ( in Boolean float64Positions )

Constructor.

float64Positions If true, positions will use a Float64 precision (Vec3_d)


PolygonMesh ( in PolygonMesh other )

copy constructor


PolygonMesh ( in String debugName )

Constructor taking the string to be used as the name.

debugName the name displayed in debugging


PolygonMesh ( in String debugName, in Boolean float64Positions )

Constructor.

debugName the name displayed in debugging
float64Positions If true, positions will use a Float64 precision (Vec3_d)


PolygonMesh ()

Constructor. By default, the PolygonMesh positions use a Float32 precision.


UInt32 PolygonMesh.addNoneOverlappingUVLayout! ( in String attributeName, in Boolean fixedResolution, in UInt32 resolution, in Float32 pixelsPerSquare, in UInt32 maxResolution, in UInt32 margin, in Float32 smoothStrength, in UInt32 smoothIterations )

Updates an existing UV space stored in a Vec2Attribute attributeName. It will * use a fixed texture resolution or one based on the overall surface area and the pixelsPerSquare setting * ensure that there are no overlapping UVs * re-package all resulting UV islands based on their surface area scale * ensure a margin of pixels between islands to avoid artifacts * smooth the islands using laplacian smoothing based on strength + iterations


UInt32 PolygonMesh.addUniqueUVAttribute! ( in String attributeName, in Boolean fixedResolution, in UInt32 resolution, in Float32 pixelsPerSquare, in UInt32 maxResolution )

Creates a new Vec2Attribute attributeName and stores a unique UV space in it. Each polygon in that UV space will be packed individually and scaled based on its surface area. fixedResolution specifies if the resolution is to be used. If fixedResolution is false: pixelsPerSquare defines how many pixels should be used per square unit of the surface area of the mesh, in that case resolution is used as the minimum resolution


PolygonMesh.applyTransform! ( in Mat44 transform )

Geometry interface: transforms the positions of the geometry and normals


PolygonMesh.applyTransform! ( in Xfo transform )

Geometry interface: transforms the positions of the geometry and normals


Boolean PolygonMesh.areGeometryLocationsEquivalent? ( in GeometryLocation location0, in GeometryLocation location1 )


PolygonMesh.clear! ()

Clears all data, including points, polygons and attributes.

注釈

The mesh and attribute versions will be incremented.


PolygonMesh PolygonMesh.clone? ()

clone method


PolygonMesh.cloneMembersTo? ( io PolygonMesh that )


Boolean PolygonMesh.cloneUVs? ( in String source, in String target )

Clones the UV (Vec2) attribute source to target and returns true if successful


PolygonMesh.convertToCPU! ()


PolygonMesh.convertToGPU! ()


PolygonMesh.copy! ( in Geometry src )

Copies all the data from source, including attributes.

注釈

This will increments the mesh and attributes’ versions.


PolygonMesh.copy! ( in PolygonMesh src )

Copies all the data from source, including attributes.

注釈

This will increments the mesh and attributes’ versions.


Size PolygonMesh.createPoints! ( in Size nb )


PolygonMesh.deleteUnusedPoints! ()

Deletes all points that have no connected polygons. Deleted points will be replaced by existing ones; see 削除されたコンポーネントインデックス群の置換 .


Size PolygonMesh.elementCount? ()

Geometry interface implementation. For a PolygonMesh, an element is a polygon.


Vec3[] PolygonMesh.getAllPointPositions? ()

Returns all point positions


LocalBoundingVolume PolygonMesh.getBoundingVolume? ()

Returns the bounding volume of the geometry, as computed from the positions attribute. This function will cache the bounding box given a specific version of the positions attribute, and will update it lazily, in a thread-safe fashion. The internal cache is stored in the BaseGeometry.metaData container.


UInt32 PolygonMesh.getClosestEdgeToLocation? ( in GeometryLocation location, out Scalar weight )

Returns the index of the first polygon point offset inside the polygon as returned by getLocationPolygonPointIndicesAndWeights


String PolygonMesh.getDebugName? ()

Returns the debug name used when constructing the geometry.


LocalBoundingVolume PolygonMesh.getElementBoundingVolume? ( in Size index )

Geometry interface implementation: computes and returns the bounding box of a polygon. For a PolygonMesh, an element is a polygon.


PolygonMesh.getLocationAttributeIndicesAndWeights? ( in GeometryLocation location, out LocalL16UInt32Array attributeIndices, out LocalL16ScalarArray weights )


UInt32 PolygonMesh.getMemType? ()

Returns the memory location id. CPU = 0, GPU = 1, VSM = 2;


Ref<ThreadsafeMetaDataContainer> PolygonMesh.getMetaData? ()

Returns the metaData container for this Geometry.


UInt32 PolygonMesh.getPointIterNextOffInWingInternal? ( in DataIter pointIter, in UInt32 offset, in UInt32 nextOffset, in Size count, in DataIter borderDataIter )


Float32 PolygonMesh.getPolygonArea? ( in Index polygon )

Returns the surface area of a single polygon


Size PolygonMesh.getPolygonPoint? ( in Size polygon, in Size polygonPointIndex )


PolygonMesh.getPolygonPointAndNeighborIndex? ( in Size polygon, in Size polygonPointIndex, out Size point, out Size pointNeighborIndex )


Size PolygonMesh.getPolygonPointIndex? ( in Size polygon, in Size point )


PolygonMesh.getPolygonPoints? ( in Size polygon, out LocalL8UInt32Array points )


PolygonMesh.getPolygonPointsAndNeighborIndices? ( in Size polygon, out LocalL8UInt32Array points, out LocalIndexArray polygonPointIndices )


Float32 PolygonMesh.getPolygonUVArea? ( in Index polygon )

Returns the 2D area covered by a single polygon using the UV space ‘uvs0’


Float32 PolygonMesh.getPolygonUVArea? ( in Index polygon, in String attributeName )

Returns the 2D area covered by a single polygon using the UV space given by attributeName


UInt32 PolygonMesh.getStructureVersion? ()

Returns the version of the geometry structure including the the attribute set (but not attribute values).


UInt32 PolygonMesh.getVersion? ()

Returns the version of the geometry including attribute values


Boolean PolygonMesh.hasFloat64Positions? ()

Returns true if the mesh stores its positions in Float64 (double precision Vec3_d), otherwise they are stored in Float32 (single precision Vec3).


PolygonMesh.incrementPointPositionsVersion! ()

Helper for incrementing the version of the positions attribute after value changes. See Attribute versioning for more information.


Boolean PolygonMesh.isLocationInternalEdge? ( in GeometryLocation location, in Index edge )

Returns true if the location is on an internal edge


Boolean PolygonMesh.mapMaterialIDs! ( in SInt32 newIDs<> )

updates the localized material ids with a list of global IDs returns true if successful


Size PolygonMesh.nextPolygonPointIndex? ( in Size polygon, in Size polygonPointIndex )


Size PolygonMesh.previousPolygonPointIndex? ( in Size polygon, in Size polygonPointIndex )


PolygonMesh.setAllPointPositions! ( in Vec3 positions[] )

Sets all point positions


PolygonMesh.setMaterialIDOnAllPolygons! ( in SInt32 id )


ImportExportHelpers methods

PolygonMesh.generateAttributesTriangleListAsExternalArray? ( io UInt32 triangles<> )

returns the triangle attribute index list as an external array (see PolygonMesh.generateAttributesTriangleList)


PolygonMesh.getColorAsExternalArrayForTriangle? ( io Float32 values<> )

Returns all attribute values for Colors (including split values; see ポリゴンメッシュアトリビュート) The returned values are aligned with attribute indices


PolygonMesh.getColorAttributeAsExternalArray? ( io Float32 values<>, in String attributeName, in Size components )

Gets a color attribute as a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). components is the number of floats in the destination array per value.


Boolean PolygonMesh.getMeshExternalArrayForArnold? ( io Xfo meshXfo, io Boolean hasuv, io UInt32 nsides<>, io UInt32 vidxs<>, io UInt32 nidxs<>, io UInt32 uvidxs<>, io Float32 nlist<>, io Float32 vlist<>, io Float32 uvlist<> )

Outputs the mesh data as an Arnold friendly way. This includes the structure, uvs and normals.


PolygonMesh.getNormalAsExternalArrayForTriangle? ( io Float32 values<> )

Returns all attribute values for normals (including split values; see ポリゴンメッシュアトリビュート) The returned values are aligned with attribute indices


PolygonMesh.getNormalsAsExternalArray? ( io Float32 values<> )

Gets the normals as a Float32 array. If the size of values is PolygonMesh.pointCount *3, values will be ordered by point. If the size of values is PolygonMesh.polygonPointsCount *3, values will be ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). If the pointCount matches the polygonPointsCount the normals are returned in the order of the polygon points (nodes).


PolygonMesh.getNormalsAsExternalArray_d? ( io Float64 values<> )

Gets the normals as a Float64 array. If the size of values is PolygonMesh.pointCount *3, values will be ordered by point. If the size of values is PolygonMesh.polygonPointsCount *3, values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).


Size PolygonMesh.getNormalsAttributeSize? ()

returns the size of the normals attribute (0 if no normals)


PolygonMesh.getPointsAsExternalArray? ( io Float32 values<>, in Size components )

Gets the point positions as a Float32 array. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).

components indicates the number of Float32 to be returned for each point, and should be 3 or 4. If 4, a 1.0 will pad the 4th component.


PolygonMesh.getPointsAsExternalArray_d? ( io Float64 values<>, in Size components )

Gets the point positions as a Float64 array. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).

components indicates the number of Float64 to be returned for each point, and should be 3 or 4. If 4, a 1.0 will pad the 4th component.


PolygonMesh.getPositionsAsExternalArrayForTriangle? ( io Float32 values<> )

Returns all attribute values for positions (including split values; see ポリゴンメッシュアトリビュート) The returned values are aligned with attribute indices


Size PolygonMesh.getPositionsAttributeSize? ()

returns the size of the positions attribute


PolygonMesh.getScalarAttributeAsExternalArray? ( io Float32 values<>, in String attributeName, in Size components )

Gets a scalar attribute as a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). components is the number of floats in the destination array per value.


PolygonMesh.getSkinningAttributeAsExternalArray? ( io Float32 values<>, in String attributeName, in Size bones )

Gets a skinning attribute as a Float32 array. The size of values should be PolygonMesh.pointCount * bones. Values are ordered by points (Point0, Point1, Point2... ). bones is the number of bones, so the number of floats in the destination array per point.


PolygonMesh.getTopologyAsCombinedExternalArray? ( io UInt32 indices<> )

Gets the polygon sizes and polygon points as a single packed array. indices should be of size PolygonMesh.polygonCount + PolygonMesh.polygonPointsCount. indices will be ordered by polygons, containing the polygon size, followed by its points, such as: [Poly0Size, Poly0Point0, Poly0Point1, ..., Poly1Size, Poly1Point0, ...]


PolygonMesh.getTopologyAsCountsIndicesExternalArrays? ( io UInt32 counts<>, io UInt32 indices<> )

Gets the polygon sizes and polygon points as two external arrays.

counts Polygon sizes. The size of the array should be PolygonMesh.polygonCount
indices Packed polygon points, in polygon point order. The size of the array should be PolygonMesh.polygonPointsCount


PolygonMesh.getTopologyCountsAndAttributeIndices? ( out UInt32 nsides[], out UInt32 attr_idxs[] )

Extracts the count and indices that enable the raw geometry attribute data to be indexed. This method is used by the Arnold DSO in Horde.


PolygonMesh.getUVAsExternalArrayForTriangle? ( io Float32 values<> )

Returns all attribute values for UVs (including split values; see ポリゴンメッシュアトリビュート) The returned values are aligned with attribute indices


Size PolygonMesh.getUVAttributeSize? ()

returns the size of the uvs0 attribute


PolygonMesh.getUVsAsExternalArray? ( io Float32 values<>, in Size components )

Gets the uvs as a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).

components indicates the number of Float32 to be returned for each uv, and should be 2 or 3. If 3, a 0.0 will pad the 3rd component.


Vec2[] PolygonMesh.getUVsAsPackedArray? ( io UInt32 polygonPackedIndices[] )

Gets the uvs as a packed Vec2 array and an index array. The size of indices should be PolygonMesh.polygonPointsCount.


PolygonMesh.getVec2AttributeAsExternalArray? ( io Float32 values<>, in String attributeName, in Size components )

Gets a Vec2 attribute as a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). components is the number of floats in the destination array per value. Unused floats are left untouched.


PolygonMesh.getVec3AttributeAsExternalArray? ( io Float32 values<>, in String attributeName, in Size components )

Gets a Vec3 attribute as a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). components is the number of floats in the destination array per value.


Size PolygonMesh.getVertexColorAttributeSize? ()

returns the size of the uvs0 attribute


PolygonMesh.getVertexColorsAsExternalArray? ( io Float32 values<>, in Size components )

Gets the colors as a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).

components indicates the number of Float32 to be returned for each color, and should be 3 or 4.


Boolean PolygonMesh.hasUVs? ()

returns true if the PolygonMesh has uvs (stored as a Vec2 attribute named ‘uvs0’)


Boolean PolygonMesh.hasVertexColors? ()

returns true if the PolygonMesh has vertexColors (stored as a Color attribute named ‘vertexColors’)


PolygonMesh.setColorAttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size components )

Sets a color attribute from a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). components is the number of floats in the source array per value. Unused floats are left untouched.


PolygonMesh.setColorPointAttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size components )

Sets a Color attribute from a Float32 array. The size of values should be PolygonMesh.pointCount * components. Values are ordered by points (Point0, Point1, Point2, ... ). components is the number of floats in the source array per value.


PolygonMesh.setNormalsFromExternalArray! ( in Float32 values<> )

Sets the normals from a Float32 array. Values are expected to be ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).


PolygonMesh.setNormalsFromExternalArray_d! ( in Float64 values<> )

Sets the normals from a Float64 array (will be converted to Float32). Values are expected to be ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).


PolygonMesh.setPointsFromExternalArray! ( in Float32 values<>, in Size components )

Sets the point positions from a Float32 array. Values are expected to be ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).

components indicates the number of Float32 for each point. Only the 3 first values (XYZ) will be read.


PolygonMesh.setPointsFromExternalArray_d! ( in Float64 values<>, in Size components )

Sets the point positions from a Float64 array. Values are expected to be ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).

components indicates the number of Float64 for each point. Only the 3 first values (XYZ) will be read.


PolygonMesh.setScalarAttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size components )

Sets a scalar attribute from a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). components is the number of floats in the source array per value.


PolygonMesh.setScalarPointAttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size components )

Sets a scalar attribute from a Float32 array. The size of values should be PolygonMesh.pointCount * components. Values are ordered by points (Point0, Point1, Point2, ... ). components is the number of floats in the source array per value.


PolygonMesh.setSkinningAttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size bones )

Sets a skinning attribute from a Float32 array. The size of values should be PolygonMesh.pointCount * bones. Values are ordered by points then bones(Point0Bone0, Point0Bone1, Point0Bone2, ..., Point1Bone0, Point1Bone1... ). bones is the number of floats in the source array per value.


PolygonMesh.setSkinningPointAttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size bones )

Sets a Skinning attribute from a Float32 array. The size of values should be PolygonMesh.pointCount * bones. Values are ordered by points then bones(Point0Bone0, Point0Bone1, Point0Bone2, ..., Point1Bone0, Point1Bone1... ). bones is the number of floats in the source array per value.


PolygonMesh.setTopologyFromCombinedExternalArray! ( in UInt32 indices<> )

Adds polygons from polygon sizes and polygon points as a single packed array. indices will be ordered by polygons, containing the polygon size, followed by its points, such as: [Poly0Size, Poly0Point0, Poly0Point1, ..., Poly1Size, Poly1Point0, ...]


PolygonMesh.setTopologyFromCountsIndicesExternalArrays! ( in UInt32 counts<>, in UInt32 indices<> )

Adds polygons from polygon sizes and polygon points as two external arrays.

counts Polygon sizes, with one size per polygon to be created.
indices Packed polygon points, ordered by polygon: [Poly0Point0, Poly0Point1, ..., Poly1Point0, ...]


PolygonMesh.setUVsFromExternalArray! ( in Float32 values<>, in Size components )

Sets the uvs from a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).

components indicates the number of Float32 for each uv, and should be 2 or 3. If 3, the 3rd component is ignored.


PolygonMesh.setVec2AttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size components )

Sets a vec2 attribute from a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). components is the number of floats in the source array per value.


PolygonMesh.setVec2PointAttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size components )

Sets a Vec2 attribute from a Float32 array. The size of values should be PolygonMesh.pointCount * components. Values are ordered by points (Point0, Point1, Point2, ... ). components is the number of floats in the source array per value.


PolygonMesh.setVec3AttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size components )

Sets a Vec3 attribute from a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ). components is the number of floats in the source array per value.


PolygonMesh.setVec3PointAttributeFromExternalArray! ( in Float32 values<>, in String attributeName, in Size components )

Sets a Vec3 attribute from a Float32 array. The size of values should be PolygonMesh.pointCount * components. Values are ordered by points (Point0, Point1, Point2, ... ). components is the number of floats in the source array per value.


PolygonMesh.setVertexColorsFromExternalArray! ( in Float32 values<>, in Size components )

Sets the colors from a Float32 array. The size of values should be PolygonMesh.polygonPointsCount * components. Values are ordered by polygon points (Poly0Point0, Poly0Point1, Poly0Point2, ..., Poly1Point0, Poly1Point1... ).

components indicates the number of Float32 for each color, and should be 3 or 4. If 3, the alpha will be set to 1.0.


SpatialQueryable methods

Ref<SpatialQuery> PolygonMesh.beginSpatialQuery? ()

Returns a local SpatialQuery object for issuing one or multiple queries. The returned SpatialQuery object must be locally released by calling SpatialQueryable.endSpatialQuery, and should not be used afterward.


PolygonMesh.endSpatialQuery? ( in Ref<SpatialQuery> query )

Releases (recycles) a query object previously obtained by a call to SpatialQueryable.beginSpatialQuery .


GeometryLocation PolygonMesh.getClosest? ( in Vec3 position, in Vec3 scaling, in Scalar maxUnscaledDistance )

A shortcut to SpatialQuery.getClosest, without the need to call SpatialQueryable.beginSpatialQuery and SpatialQueryable.endSpatialQuery. See SpatialQuery.getClosest for more details.


PolygonMesh.getLocationAttributeIndicesAndWeights? ( in GeometryLocation location, out UInt32 attributeIndices[3], out Scalar weights[3] )

Returns the attribute indices and weights that define the location.

注釈

Other versions of this function return points or polygon point indices instead of the attribute indices.

注釈

A current limitation is that all polygons will be triangulated a simple triangle fan

location Input location. The location must be valid, and must have been created by this PolygonMesh or one with the same structure, and no structure changes should have been made.
attributeIndices Triplet of attribute indices defining the triangle (see ポリゴンメッシュアトリビュート).
weights Triangle barycentric coordinates corresponding to each attribute index


PolygonMesh.getLocationPointsAndWeights? ( in GeometryLocation location, out UInt32 points[3], out Scalar weights[3] )

Returns the points and weights that define the location.

注釈

Other versions of this function return the polygon point indices or attribute indices instead of the points.

注釈

A current limitation is that all polygons will be triangulated a simple triangle fan

location Input location. The location must be valid, and must have been created by this PolygonMesh or one with the same structure, and no structure changes should have been made.
points Triplet of points defining the triangle.
weights Triangle barycentric coordinates corresponding to each point


Size PolygonMesh.getLocationPolygon? ( in GeometryLocation location )

Returns the polygon on which the location is defined.

location Input location. The location must be valid, and must have been created by this PolygonMesh or one with the same structure, and no structure changes should have been made.


PolygonMesh.getLocationPolygonPointIndicesAndWeights? ( in GeometryLocation location, out UInt32 polygonPointIndices[3], out Scalar weights[3] )

Returns the polygon point indices and weights that define the location, relative to the polygon returned by PolygonMesh.getLocationPolygon.

注釈

Other versions of this function return the points or attribute indices instead of the points polygonPointIndices.

注釈

A current limitation is that all polygons will be triangulated a simple triangle fan

location Input location. The location must be valid, and must have been created by this PolygonMesh or one with the same structure, and no structure changes should have been made.
polygonPointIndices Triplet of polygonPointIndex defining the triangle, each in the [0 .. PolygonMesh.getPolygonSize -1] range.
weights Triangle barycentric coordinates corresponding to each polygonPointIndices


Vec3 PolygonMesh.getNormalAtLocation? ( in GeometryLocation location )

Evaluates the normal attribute at a specific location.

location Input location. The location must be valid, and must have been created by this PolygonMesh or one with the same structure, and no structure changes should have been made to the PolygonMesh


Vec3 PolygonMesh.getPositionAtLocation? ( in GeometryLocation location )

From a GeometryLocation, returns the local position as a Vec3.

注釈

If the positions are stored as double precision (Float64), a conversion will be applied.

location Input location. The location must be valid, and must have been created by this PolygonMesh or one with the same structure, and no structure changes should have been made to the PolygonMesh


Vec3_d PolygonMesh.getPositionAtLocation_d? ( in GeometryLocation location )

From a GeometryLocation, returns the local position as a Vec3_d (double precision Float64).

注釈

If the positions are stored as single precision (Float32), a conversion will be applied.

location Input location. The location must be valid, and must have been created by this PolygonMesh or one with the same structure, and no structure changes should have been made to the PolygonMesh


PolygonMesh.prepareForSpatialQueries? ( in Size approximateNumberOfQueries, in GenericValueContainer options )

Builds an acceleration structure that will accelerate future queries such as SpatialQueryable.raycast or SpatialQueryable.getClosest . For built-in Geometry types, the default acceleration structure is the Octree, however it is possible to use a SparseGrid (see options parameter description). See 高速化構造 for more details about acceleration structures.

Important: prepareForSpatialQueries must be called if geometry’s structure or positions changed. Otherwise, the acceleration will be silently disabled.

Because building an acceleration structure incurs memory and computation overhead, this function should be called only when multiple queries are expected. The acceleration structure will remain attached to the geometry so it can be reused and incrementally updated, unless SpatialQueryable.removeSpatialQueryAcceleration is explicitly called.

注釈

Calling prepareForSpatialQueries is not threadsafe, and must be called before issuing parallel queries.

options can be null, values are implementation specific, and can be configured by calling one of these: PrepareForSpatialQueries_setOctree, PrepareForSpatialQueries_setOctreeMaxDepth, PrepareForSpatialQueries_setSparseGrid, PrepareForSpatialQueries_setSparseGridCellSize, PrepareForSpatialQueries_setSparseGridAutoCellSizeMultiplier .
approximateNumberOfQueries an approximation of the number of queries (eg: raycast) that will be issued. Structures such as the Octree with choose their level of precision accordingly, to provide an optimal balance between build and query costs.


GeometryLocation PolygonMesh.raycast? ( in Ray ray, in Boolean doubleSided, in Scalar coneThreshold, in Scalar maxDistance )

A shortcut to SpatialQuery.raycast, without the need to call SpatialQueryable.beginSpatialQuery and SpatialQueryable.endSpatialQuery. See SpatialQuery.raycast for more details.


PolygonMesh.removeSpatialQueryAcceleration! ()

Releases the cached acceleration structure created by SpatialQueryable.prepareForSpatialQueries, which will reduce memory usage. However, if future queries are expected for the same geometry (even if modified), calling this method can significatively reduce the performance, as the next SpatialQueryable.prepareForSpatialQueries will need to fully fully reallocate and rebuild on acceleration structure (prevents potential incremental updates).


Attributes methods

Boolean PolygonMesh.arePointAttributesUniform? ( in Size point )

Returns true if values are the same (shared, unsplit) for all point polygon neighbors, for all attributes.


Boolean PolygonMesh.arePointIterAttributesUniform? ( in DataIter pointIter )

Returns true if values are the same (shared, unsplit) for all point polygon neighbors, for all attributes.


Boolean PolygonMesh.arePolygonAttributeUniformForAllCorners? ( in Size polygon )

Returns true if values are the same (shared, unsplit) for all points in a polygon, for all attributes.


Ref<GeometryAttribute> PolygonMesh.getAttribute? ( in String name )

Returns an existing attribute from its name, or null if not found.


Ref<GeometryAttribute> PolygonMesh.getAttribute? ( in String name, in Type attributeType )

Returns an existing attribute from its name and type, or null if not found.


Ref<GeometryAttributes> PolygonMesh.getAttributes? ()

Returns the GeometryAttributes container for this PolygonMesh.


Ref<GeometryAttribute> PolygonMesh.getOrCreateAttribute! ( in String name, in Type attributeType )

Creates an attribute of the given type and name.

注釈

this function is mostly used for backward compatibility. use getOrCreate[Type]Attribute() instead.


Ref<ColorAttribute> PolygonMesh.getOrCreateColorAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<IntegerAttribute> PolygonMesh.getOrCreateIntegerAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<Mat33Attribute> PolygonMesh.getOrCreateMat33Attribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<Mat44Attribute> PolygonMesh.getOrCreateMat44Attribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<QuatAttribute> PolygonMesh.getOrCreateQuatAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<RGBAAttribute> PolygonMesh.getOrCreateRGBAAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<RGBAttribute> PolygonMesh.getOrCreateRGBAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<ScalarAttribute> PolygonMesh.getOrCreateScalarAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<ScalarConstantArrayAttribute> PolygonMesh.getOrCreateScalarConstantArrayAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<SkinningAttribute> PolygonMesh.getOrCreateSkinningAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<UInt16ConstantArrayAttribute> PolygonMesh.getOrCreateUInt16ConstantArrayAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<UInt32Attribute> PolygonMesh.getOrCreateUInt32Attribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<Vec2Attribute> PolygonMesh.getOrCreateVec2Attribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<Vec3Attribute> PolygonMesh.getOrCreateVec3Attribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<Vec3_dAttribute> PolygonMesh.getOrCreateVec3_dAttribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Ref<Vec4Attribute> PolygonMesh.getOrCreateVec4Attribute! ( in String name )

If it exists, returns the attribute of that name, else creates it.


Size PolygonMesh.getPointAttributeIndex? ( in Size point )

Returns the attribute index corresponding to the point, if values are shared. If values are unshared (split values), returns one of the attribute indices corresponding to the point. See ポリゴンメッシュアトリビュート for more information about attribute indices.


Size PolygonMesh.getPointAttributeIndex? ( in Size point, in Size neighborPolygonIndex )

Returns the attribute index for the point, at a specific neighbor polygon index. This index can then be used to get the related GeometryAttribute values in the attributes container (PolygonMesh.getAttributes).

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
/*
** Example: getPointAttributeIndex
*/

require Geometry;
  
operator entry() {

      PolygonMesh mesh();
      mesh.createPoints(6);
      mesh.beginStructureChanges();
      mesh.addPolygon(0,1,4,3);
      mesh.addPolygon(1,2,5,4);
      mesh.endStructureChanges();
      
      //Set a different weight attribute value for each polygon
      Ref<ScalarAttribute> weights = mesh.getOrCreateScalarAttribute('weights');
      
      for( UInt32 polygon = 0; polygon < 2; ++polygon ) {
        for( UInt32 polygonPointIndex = 0; polygonPointIndex < 4; ++polygonPointIndex )
          mesh.setPolygonAttribute( polygon, polygonPointIndex, weights, polygon == 0 ? 0.0 : 1.0 );
      }
      
      //Print value characteristics for point 0 and 1
      for( Size point = 0; point < 2; ++point ) {
        report("Point " + point + ":");
        report("  Uniform (shared) weights: " + mesh.isPointAttributeUniform( point, weights ) );
      
        Size pointPolygonCount = mesh.getPointPolygonCount( point );
        for( Size neighborPolygonIndex = 0; neighborPolygonIndex < pointPolygonCount; ++neighborPolygonIndex ) {
          Size neighborPolygon = mesh.getPointPolygon( point, neighborPolygonIndex );
          Size attributeIndex = mesh.getPointAttributeIndex( point, neighborPolygonIndex );
          report("  Neighbor " + neighborPolygonIndex + ": polygon=" + neighborPolygon
                 + ", attributeIndex=" + attributeIndex
                 + ", weightValue=" + weights.values[attributeIndex] );
        }
      }
  
}

/*
** Output:

Point 0:
  Uniform (shared) weights: true
  Neighbor 0: polygon=0, attributeIndex=0, weightValue=+0.0
Point 1:
  Uniform (shared) weights: false
  Neighbor 0: polygon=1, attributeIndex=6, weightValue=+1.0
  Neighbor 1: polygon=0, attributeIndex=1, weightValue=+0.0

*/


Size PolygonMesh.getPointFromAttributeIndex? ( in Size attributeIndex )

Returns the point index corresponding to the attribute. Note that if attribute values are unshared. the point might correspond to multiple attribute indices.


Size PolygonMesh.getPolygonAttributeIndex? ( in Size polygon, in Size polygonPointIndex )

Returns the attribute index for a specific polygon point. This index can then be used to get the related GeometryAttribute values in the attributes container (PolygonMesh.getAttributes).

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.


PolygonMesh.getPolygonPackedSharedAttributeValues? ( in Ref<GeometryAttribute> meshAttribute, io GeometryAttribute outValues, io UInt32 polygonPackedIndices[] )

Extract values of an attribute into a target attribute outValues and index table. The outputted attribute values will have optimal sharing around vertices, so outValues.size() <= meshAttribute.size().

The input and output attributes (meshAttribute and outValues) must be have the same type. Only the input meshAttribute should be an existing mesh attributes. The output outValues is only an output data container.

The polygonPackedIndices index table contains polygon packed data. It will contain an index relative to the outValues attribute, for each polygon point, in polygons order:

polygonPackedIndices =
  [outValues index for polygon0.polygonPointIndex0, 
   outValues index for polygon0.polygonPointIndex1,
   outValues index for polygon0.polygonPointIndex2, 
   ..., 
   outValues index for polygon1.polygonPointIndex0, 
   outValues index for polygon1.polygonPointIndex1
   ... ]


Boolean PolygonMesh.has? ( in String name )

Returns true if an attribute with this name exists.


Boolean PolygonMesh.hasAttribute? ( in String name )

Returns true if an attribute with this name exists. Overload of the .has method.


Boolean PolygonMesh.isPointAttributeUniform? ( in Size point, in Ref<GeometryAttribute> attribute )

Returns true if values are the same (shared, unsplit) for all point polygon neighbors, for this attributes. See PolygonMesh.getPointAttributeIndex for an example of usage.


Boolean PolygonMesh.isPolygonAttributeUniformForAllCorners? ( in Size polygon, in Ref<GeometryAttribute> attribute )

Returns true if values are the same (shared, unsplit) for all points in a polygon, for this attributes.


PolygonMesh.removeAttribute! ( in String name )

Removes an existing attribute from the attributes container.


PolygonMesh.resetAttributeAndAvoidSharingChanges! ( in Ref<GeometryAttribute> attribute )

Performance hint for the polygon mesh when, for a given attribute, all values will be set again and values’ point shared / unshared layout is not expected to change much. By calling this function, the PolygonMesh will not try to re-share attribute values that have previously been split, and only additional splits might occur when required. See ポリゴンメッシュアトリビュート for more information about how attribute values are shared around points.


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Color values<> )

Sets all attribute values from an array containing polygon packed data. values is expected to have one value for each polygon point, in polygons order:

values =
  [value for polygon0.polygonPointIndex0, 
   value for polygon0.polygonPointIndex1,
   value for polygon0.polygonPointIndex2, 
   ..., 
   value for polygon1.polygonPointIndex0, 
   value for polygon1.polygonPointIndex1
   ... ]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Color values<>, in Size optionalValuesIndices[] )

Sets all attribute values from an array containing polygon packed data with an index table.

optionalValuesIndices is expected to have an index relative to the values array, for polygon point, in polygons order:

optionalValuesIndices =
  [value index for polygon0.polygonPointIndex0, 
   value index for polygon0.polygonPointIndex1,
   value index for polygon0.polygonPointIndex2, 
   ..., 
   value index for polygon1.polygonPointIndex0, 
   value index for polygon1.polygonPointIndex1
   ... ]

values = [...]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in RGB values<> )

Sets all attribute values from an array containing polygon packed data. values is expected to have one value for each polygon point, in polygons order:

values =
  [value for polygon0.polygonPointIndex0, 
   value for polygon0.polygonPointIndex1,
   value for polygon0.polygonPointIndex2, 
   ..., 
   value for polygon1.polygonPointIndex0, 
   value for polygon1.polygonPointIndex1
   ... ]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in RGB values<>, in Size optionalValuesIndices[] )

Sets all attribute values from an array containing polygon packed data with an index table.

optionalValuesIndices is expected to have an index relative to the values array, for polygon point, in polygons order:

optionalValuesIndices =
  [value index for polygon0.polygonPointIndex0, 
   value index for polygon0.polygonPointIndex1,
   value index for polygon0.polygonPointIndex2, 
   ..., 
   value index for polygon1.polygonPointIndex0, 
   value index for polygon1.polygonPointIndex1
   ... ]

values = [...]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in RGBA values<> )

Sets all attribute values from an array containing polygon packed data. values is expected to have one value for each polygon point, in polygons order:

values =
  [value for polygon0.polygonPointIndex0, 
   value for polygon0.polygonPointIndex1,
   value for polygon0.polygonPointIndex2, 
   ..., 
   value for polygon1.polygonPointIndex0, 
   value for polygon1.polygonPointIndex1
   ... ]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in RGBA values<>, in Size optionalValuesIndices[] )

Sets all attribute values from an array containing polygon packed data with an index table.

optionalValuesIndices is expected to have an index relative to the values array, for polygon point, in polygons order:

optionalValuesIndices =
  [value index for polygon0.polygonPointIndex0, 
   value index for polygon0.polygonPointIndex1,
   value index for polygon0.polygonPointIndex2, 
   ..., 
   value index for polygon1.polygonPointIndex0, 
   value index for polygon1.polygonPointIndex1
   ... ]

values = [...]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Scalar values<> )

Sets all attribute values from an array containing polygon packed data. values is expected to have one value for each polygon point, in polygons order:

values =
  [value for polygon0.polygonPointIndex0, 
   value for polygon0.polygonPointIndex1,
   value for polygon0.polygonPointIndex2, 
   ..., 
   value for polygon1.polygonPointIndex0, 
   value for polygon1.polygonPointIndex1
   ... ]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Scalar values<>, in Size optionalValuesIndices[] )

Sets all attribute values from an array containing polygon packed data with an index table.

optionalValuesIndices is expected to have an index relative to the values array, for polygon point, in polygons order:

optionalValuesIndices =
  [value index for polygon0.polygonPointIndex0, 
   value index for polygon0.polygonPointIndex1,
   value index for polygon0.polygonPointIndex2, 
   ..., 
   value index for polygon1.polygonPointIndex0, 
   value index for polygon1.polygonPointIndex1
   ... ]

values = [...]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Vec2 values<> )

Sets all attribute values from an array containing polygon packed data. values is expected to have one value for each polygon point, in polygons order:

values =
  [value for polygon0.polygonPointIndex0, 
   value for polygon0.polygonPointIndex1,
   value for polygon0.polygonPointIndex2, 
   ..., 
   value for polygon1.polygonPointIndex0, 
   value for polygon1.polygonPointIndex1
   ... ]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Vec2 values<>, in Size optionalValuesIndices[] )

Sets all attribute values from an array containing polygon packed data with an index table.

optionalValuesIndices is expected to have an index relative to the values array, for polygon point, in polygons order:

optionalValuesIndices =
  [value index for polygon0.polygonPointIndex0, 
   value index for polygon0.polygonPointIndex1,
   value index for polygon0.polygonPointIndex2, 
   ..., 
   value index for polygon1.polygonPointIndex0, 
   value index for polygon1.polygonPointIndex1
   ... ]

values = [...]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Vec3 values<> )

Sets all attribute values from an array containing polygon packed data. values is expected to have one value for each polygon point, in polygons order:

values =
  [value for polygon0.polygonPointIndex0, 
   value for polygon0.polygonPointIndex1,
   value for polygon0.polygonPointIndex2, 
   ..., 
   value for polygon1.polygonPointIndex0, 
   value for polygon1.polygonPointIndex1
   ... ]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Vec3 values<>, in Size optionalValuesIndices[] )

Sets all attribute values from an array containing polygon packed data with an index table.

optionalValuesIndices is expected to have an index relative to the values array, for polygon point, in polygons order:

optionalValuesIndices =
  [value index for polygon0.polygonPointIndex0, 
   value index for polygon0.polygonPointIndex1,
   value index for polygon0.polygonPointIndex2, 
   ..., 
   value index for polygon1.polygonPointIndex0, 
   value index for polygon1.polygonPointIndex1
   ... ]

values = [...]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Vec4 values<> )

Sets all attribute values from an array containing polygon packed data. values is expected to have one value for each polygon point, in polygons order:

values =
  [value for polygon0.polygonPointIndex0, 
   value for polygon0.polygonPointIndex1,
   value for polygon0.polygonPointIndex2, 
   ..., 
   value for polygon1.polygonPointIndex0, 
   value for polygon1.polygonPointIndex1
   ... ]


PolygonMesh.setAttributeFromPolygonPackedData! ( in String name, in Vec4 values<>, in Size optionalValuesIndices[] )

Sets all attribute values from an array containing polygon packed data with an index table.

optionalValuesIndices is expected to have an index relative to the values array, for polygon point, in polygons order:

optionalValuesIndices =
  [value index for polygon0.polygonPointIndex0, 
   value index for polygon0.polygonPointIndex1,
   value index for polygon0.polygonPointIndex2, 
   ..., 
   value index for polygon1.polygonPointIndex0, 
   value index for polygon1.polygonPointIndex1
   ... ]

values = [...]


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<ColorAttribute> attribute, in Color value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<Mat33Attribute> attribute, in Mat33 value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<Mat44Attribute> attribute, in Mat44 value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<QuatAttribute> attribute, in Quat value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<RGBAAttribute> attribute, in RGBA value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<RGBAttribute> attribute, in RGB value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<ScalarConstantArrayAttribute> attribute, in LocalL16ScalarArray value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<UInt16ConstantArrayAttribute> attribute, in LocalL16UInt16Array value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<UInt32Attribute> attribute, in UInt32 value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<Vec2Attribute> attribute, in Vec2 value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<Vec3Attribute> attribute, in Vec3 value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<Vec3_dAttribute> attribute, in Vec3_d value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, in Size neighborPolygonIndex, io Ref<Vec4Attribute> attribute, in Vec4 value )

Sets an attribute’s value for a specific neighbor around the point. If the value differs from a previously set value at other neighbors of that point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
value The attribute value to be set.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<ColorAttribute> attribute, in Color value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<IntegerAttribute> attribute, in Integer value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<Mat33Attribute> attribute, in Mat33 value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<Mat44Attribute> attribute, in Mat44 value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<QuatAttribute> attribute, in Quat value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<RGBAAttribute> attribute, in RGBA value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<RGBAttribute> attribute, in RGB value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<ScalarAttribute> attribute, in Scalar value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<ScalarConstantArrayAttribute> attribute, in LocalL16ScalarArray value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<SkinningAttribute> attribute, in LocalL16UInt32Array indices, in LocalL16ScalarArray weights )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<UInt16ConstantArrayAttribute> attribute, in LocalL16UInt16Array value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<UInt32Attribute> attribute, in UInt32 value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<Vec2Attribute> attribute, in Vec2 value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<Vec3Attribute> attribute, in Vec3 value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<Vec3_dAttribute> attribute, in Vec3_d value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPointAttribute! ( in Size point, io Ref<Vec4Attribute> attribute, in Vec4 value )

Sets an attribute’s value for all neighbors around the point (uniform / shared value). The attribute must be one of this mesh’s attributes.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function won’t change the attribute sharing layout. This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<ColorAttribute> attribute, in Color value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<IntegerAttribute> attribute, in Integer value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<Mat33Attribute> attribute, in Mat33 value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<Mat44Attribute> attribute, in Mat44 value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<QuatAttribute> attribute, in Quat value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<RGBAAttribute> attribute, in RGBA value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<RGBAttribute> attribute, in RGB value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<ScalarAttribute> attribute, in Scalar value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<ScalarConstantArrayAttribute> attribute, in LocalL16ScalarArray value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<SkinningAttribute> attribute, in LocalL16UInt32Array indices, in LocalL16ScalarArray weights )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<UInt16ConstantArrayAttribute> attribute, in LocalL16UInt16Array value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<UInt32Attribute> attribute, in UInt32 value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<Vec2Attribute> attribute, in Vec2 value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<Vec3Attribute> attribute, in Vec3 value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<Vec3_dAttribute> attribute, in Vec3_d value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


PolygonMesh.setPolygonAttribute! ( in Size polygon, in Size polygonPointIndex, io Ref<Vec4Attribute> attribute, in Vec4 value )

Sets an attribute’s value for a specific polygon point. If the value differs from a previously set value at other neighbors of around the connected point, another attributeIndex will be used (attribute split), potentially modifying the global attribute sharing layout. See PolygonMesh.getPointAttributeIndex for an example of usage.

注釈

Once values have been set for that attribute, call GeometryAttribute.incrementVersion (see Attribute versioning)

注釈

This function is not threadsafe as it can modify the attribute sharing layout, which is common to all attributes of the mesh.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
value The attribute value to be set.


Debugging methods

PolygonMesh._validate! ()

Validates the mesh structure, and reports structural errors. Reported errors might indicate a bug in some of the mesh methods, or data corruption.


String PolygonMesh.getDesc? ( in Boolean withAttributes )

Returns a description of the mesh See PolygonMesh.getDesc?( Boolean, Boolean ) for more details.

withAttributes Prints all attribute values


String PolygonMesh.getDesc? ( in Boolean withAttributes, in Boolean useUnitTestPrint )

Returns a description of the mesh, which includes:

注釈

Must be called outside of PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges brackets.

withAttributes Include the attribute values in the description. If a value is split (unshared), each neighborPolygonIndex will print its value and attributeIndex. See ポリゴンメッシュアトリビュート for more details about attribute indices.
useUnitTestPrint use the unitTestPrint method to ensure that the values are consistent accross platforms (used in unit testing).
/*
** Example: getDesc
*/

require Geometry;
  
operator entry() {

      //Add a 2X2 grid if size 2.0
      PolygonMesh p();
      p.addPlane(Xfo(), 2.0, 2.0, 2, 2);
      report( p.getDesc(false) );
  
}

/*
** Output:

Mesh: pointCount: 9 polygonCount: 4 nbAttributeVectors: 9
  Points (adjacent polygons as 'polygon.neighborPolygonIndex', 
          borders as '|', closed wing starts as '<<'):
    0: 1 polygons:  |0.1
    1: 2 polygons:  |0.0, 1.1
    2: 1 polygons:  |1.0
    3: 2 polygons:  |2.1, 0.2
    4: 4 polygons:  <<3.1, 1.2, 0.3, 2.0
    5: 2 polygons:  |1.3, 3.0
    6: 1 polygons:  |2.2
    7: 2 polygons:  |3.2, 2.3
    8: 1 polygons:  |3.3
  Polygons (connected points as 'point.polygonPointIndex', borders as '|'):
    0: 4 points: 1.0 |, 0.0 |, 3.1, 4.2
    1: 4 points: 2.0 |, 1.1, 4.1, 5.0 |
    2: 4 points: 4.3, 3.0 |, 6.0 |, 7.1
    3: 4 points: 5.1, 4.0, 7.0 |, 8.0 |


*/


Edge methods

Size PolygonMesh.getEdgeFirstPoint? ( in PolygonMeshEdge edge )

Returns the first point of the edge. See PolygonMeshEdge for an example of usage.

注釈

The edge direction is not necessarily the same as polygon points’ order; see Edge direction


PolygonMeshEdge PolygonMesh.getEdgeFromPoints? ( in Size point1, in Size point2 )

Returns the edge passing through point1 and point2, if one exists. An invalid edge is returned if none exist (PolygonMeshEdge.isInitialized == false).

注釈

Exceptionally, multiple edges (different wings) can connect point1 and point2 (eg: 4 polygons in a X junction), in which case an arbitrary edge will be returned.


Size PolygonMesh.getEdgeLeftPolygon? ( in PolygonMeshEdge edge )

Returns the polygon at the left of the edge. By convention, an initialized edge always has a polygon at its left. See PolygonMeshEdge for an example of usage.


Size PolygonMesh.getEdgeRightPolygon? ( in PolygonMeshEdge edge )

Returns the polygon at the right of the edge. If the edge is a border, InvalidIndex will be returned. See PolygonMeshEdge for an example of usage.


Size PolygonMesh.getEdgeSecondPoint? ( in PolygonMeshEdge edge )

Returns the second point of the edge. See PolygonMeshEdge for an example of usage.

注釈

The edge direction is not necessarily the same as polygon points’ order; see Edge direction


PolygonMeshEdge PolygonMesh.getPointEdge? ( in Size point, in Size pointEdgeIndex )

Returns the Nth edge around a point, in the range [0 .. PolygonMesh.getPointEdgeCount -1]. See PolygonMeshEdge for an example of usage.


Size PolygonMesh.getPointEdgeCount? ( in Size point )

Returns the number of edges around a point. Note that this will be more than PolygonMesh.getPointPolygonCount if there is any polygon border (open wing; see ボーダーとウィング). See PolygonMeshEdge for an example of usage.


PolygonMeshEdge PolygonMesh.getPolygonEdge? ( in Size polygon, in Size polygonPointIndex )

Returns polygon’s edge formed by polygon point indices polygonPointIndex and PolygonMesh.nextPolygonPointIndex (polygonPointIndex).

注釈

The edge direction is not necessarily the same as polygon points’ order; see Edge direction

polygon Index of the polygon
polygonPointIndex Index of edge’s first polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range


Modeling methods

Size PolygonMesh._addPolygon! ( in LocalL8UInt32Array points, in Boolean updateStructure )

Creates new points and returns the index of the first point. The first point index is always equal to the previous value of PolygonMesh.pointCount.

注釈

In specific cases, the position and attributes values for these new points might contain garbage values until these are initialized.


PolygonMesh.addExtrusion! ( in Xfo xfos[], in Vec3 profile[] )

Appends a mesh extrusion of a profile defined by a linear closed curve (line segments), where a transform of each section is specified.

xfo Transform to be applied to each profile copy. Each consecutive transform pair will be connected by a polygon loop.
profile Profile points, defining a closed linear curve


PolygonMesh.addExtrusion! ( in Xfo xfos[], in Vec3 profile[], in Boolean close )

Appends a mesh extrusion of a profile defined by a linear curve (line segments), where a transform of each section is specified.

xfo Transform to be applied to each profile copy. Each consecutive transform pair will be connected by a polygon row (or loop if close).
profile Profile points, defining a linear curve (or closed curve if close)
close If true, the profile is a treated as a circular array of points (closed curve)


Size PolygonMesh.addPolygon! ( in LocalL8UInt32Array points )

Creates a new polygon connecting the points in the specified order (counter-clockwise), and returns new polygon’s index. For performance reasons, this function must be called between a PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges bracket (see メッシュ構造の変更 for more details).

注釈

Point indices must be valid (previously created with PolygonMesh.createPoints)

注釈

The PolygonMesh.addPolygonAndUpdateStructure variants can be slower when adding multiple polygons, but doesn’t require a change bracket

/*
** Example: addPolygon
*/

require Geometry;
  
operator entry() {

      PolygonMesh p();
      
      // Create a polygon made of 8 points
      p.beginStructureChanges();
      p.createPoints(8);
      
      LocalL8UInt32Array points;
      for( Size i = 0; i < 8; ++i )
        points.push(i);
      
      Size polygonIndex = p.addPolygon(points);
      p.endStructureChanges();
      
      report("polygon size = " + p.getPolygonSize( polygonIndex ) );
  
}

/*
** Output:

polygon size = 8

*/


Size PolygonMesh.addPolygon! ( in Size ptIdx1, in Size ptIdx2, in Size ptIdx3 )

Creates a new triangle connecting the points in the specified order (counter-clockwise), and returns new polygon’s index. This is a simple wrapper of the more generic PolygonMesh.addPolygon( LocalL8UInt32Array ). For performance reasons, this function must be called between a PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges bracket (see メッシュ構造の変更 for more details).

注釈

Point indices must be valid (previously created with PolygonMesh.createPoints)

注釈

The PolygonMesh.addPolygonAndUpdateStructure variants can be slower when adding multiple polygons, but doesn’t require a change bracket

/*
** Example: addPolygon
*/

require Geometry;
  
operator entry() {

      PolygonMesh p();
      
      p.beginStructureChanges();
      p.createPoints(3);
      Size polygonIndex = p.addPolygon(0, 1, 2);
      p.endStructureChanges();
      
      report("polygon size = " + p.getPolygonSize( polygonIndex ) );
  
}

/*
** Output:

polygon size = 3

*/


Size PolygonMesh.addPolygon! ( in Size ptIdx1, in Size ptIdx2, in Size ptIdx3, in Size ptIdx4 )

Creates a new quadrilateral connecting the points in the specified order (counter-clockwise), and returns new polygon’s index. This is a simple wrapper of the more generic PolygonMesh.addPolygon( LocalL8UInt32Array ). For performance reasons, this function must be called between a PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges bracket (see メッシュ構造の変更 for more details).

注釈

Point indices must be valid (previously created with PolygonMesh.createPoints)

注釈

The PolygonMesh.addPolygonAndUpdateStructure variants can be slower when adding multiple polygons, but doesn’t require a change bracket

/*
** Example: addPolygon
*/

require Geometry;
  
operator entry() {

      PolygonMesh p();
      
      p.beginStructureChanges();
      p.createPoints(4);
      Size polygonIndex = p.addPolygon(0, 1, 2, 3);
      p.endStructureChanges();
      
      report("polygon size = " + p.getPolygonSize( polygonIndex ) );
  
}

/*
** Output:

polygon size = 4

*/


Size PolygonMesh.addPolygonAndUpdateStructure! ( in LocalL8UInt32Array points )

Similar to PolygonMesh.addPolygon, but doesn’t require to be within a PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges bracket (see メッシュ構造の変更 for more details).

注釈

Point indices must be valid (previously created with PolygonMesh.createPoints)

注釈

This method can be slower than PolygonMesh.addPolygon if adding multiple polygons

/*
** Example: addPolygonAndUpdateStructure
*/

require Geometry;
  
operator entry() {

      PolygonMesh p();
      
      // Create a polygon made of 8 points
      p.createPoints(8);
      LocalL8UInt32Array points;
      for( Size i = 0; i < 8; ++i )
        points.push(i);
      
      Size polygonIndex = p.addPolygonAndUpdateStructure(points);
      report("polygon size = " + p.getPolygonSize( polygonIndex ) );
  
}

/*
** Output:

polygon size = 8

*/


Size PolygonMesh.addPolygonAndUpdateStructure! ( in Size ptIdx1, in Size ptIdx2, in Size ptIdx3 )

Similar to PolygonMesh.addPolygon, but doesn’t require to be within a PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges bracket (see メッシュ構造の変更 for more details). This is a simple wrapper of the more generic PolygonMesh.addPolygonAndUpdateStructure( LocalL8UInt32Array ).

注釈

Point indices must be valid (previously created with PolygonMesh.createPoints)

注釈

This method can be slower than PolygonMesh.addPolygon if adding multiple polygons

/*
** Example: addPolygonAndUpdateStructure
*/

require Geometry;
  
operator entry() {

      PolygonMesh p();
      
      // Create a polygon made of 8 points
      p.createPoints(3);
      Size polygonIndex = p.addPolygonAndUpdateStructure(0, 1, 2);
      report("polygon size = " + p.getPolygonSize( polygonIndex ) );
  
}

/*
** Output:

polygon size = 3

*/


Size PolygonMesh.addPolygonAndUpdateStructure! ( in Size ptIdx1, in Size ptIdx2, in Size ptIdx3, in Size ptIdx4 )

Similar to PolygonMesh.addPolygon, but doesn’t require to be within a PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges bracket (see メッシュ構造の変更 for more details). This is a simple wrapper of the more generic PolygonMesh.addPolygonAndUpdateStructure( LocalL8UInt32Array ).

注釈

Point indices must be valid (previously created with PolygonMesh.createPoints)

注釈

This method can be slower than PolygonMesh.addPolygon if adding multiple polygons

/*
** Example: addPolygonAndUpdateStructure
*/

require Geometry;
  
operator entry() {

      PolygonMesh p();
      
      // Create a polygon made of 8 points
      p.createPoints(4);
      Size polygonIndex = p.addPolygonAndUpdateStructure(0, 1, 2, 3);
      report("polygon size = " + p.getPolygonSize( polygonIndex ) );
  
}

/*
** Output:

polygon size = 4

*/


PolygonMesh.addPolygons! ( in Size polygonSizes<>, in Size packedPolygonPointIndices<> )

Adds many polygons in batch, using a packed size and points array.

For example, if a triangle T and a quadrilateral Q are added, the following array layout should be used:

  • polygonSizes = [size of T = 3, size of Q = 4]
  • packedPolygonPointIndices = [T.point0, T.point1, T.point2, Q.point0, Q.point1, Q.point2]

注釈

Point indices in packedPolygonPointIndices must be valid (previously created with PolygonMesh.createPoints)

/*
** Example: addPolygons
*/

require Geometry;
  
operator entry() {

      PolygonMesh p();
      p.createPoints(8);
      
      //Define a quad, then a triangle, then a pentagon
      Size polygonSizes[];
      Size packedPolygonPointIndices[];
      
      polygonSizes.push(4);
      packedPolygonPointIndices.push(0);
      packedPolygonPointIndices.push(1);
      packedPolygonPointIndices.push(2);
      packedPolygonPointIndices.push(3);
      
      polygonSizes.push(3);
      packedPolygonPointIndices.push(0);
      packedPolygonPointIndices.push(4);
      packedPolygonPointIndices.push(1);
      
      polygonSizes.push(5);
      packedPolygonPointIndices.push(0);
      packedPolygonPointIndices.push(3);
      packedPolygonPointIndices.push(5);
      packedPolygonPointIndices.push(6);
      packedPolygonPointIndices.push(7);
      
      p.addPolygons( polygonSizes, packedPolygonPointIndices );
      for( Size i = 0; i < p.polygonCount(); ++i )
        report("Polygon " + i + ": size = " + p.getPolygonSize(i) );
  
}

/*
** Output:

Polygon 0: size = 4
Polygon 1: size = 3
Polygon 2: size = 5

*/


PolygonMesh.addRevolution! ( in Xfo xfo, in Vec3 profile[], in Vec3 center, in Vec3 axis, in Size detail )

Appends a revolution mesh around a profile defined by a linear curve (line segments).

xfo Transform to be applied to all resulting points
profile Profile points. A polygon loop will be created for each pair of consecutive point.
center Center (pivot) for profile’s rotation around the axis
axis Axis around which the profile will be rotated to create the revolution mesh
detail Number of rotation steps (angle for each step = TWO_PI / detail)


PolygonMesh.addRevolution! ( in Xfo xfo, in Vec3 profile[], in Vec3 center, in Vec3 axis, in Size detail, in Vec2 range, in Boolean close )

Appends a revolution mesh around a profile defined by a linear curve (line segments).

xfo Transform to be applied to all resulting points
profile Profile points. A polygon row (or loop if close) will be created for each pair of consecutive point.
center Center (pivot) for profile’s rotation around the axis
axis Axis around which the profile will be rotated to create the revolution mesh
detail Number of rotation steps (to subdivide the range.x to range.y angles)
range Start and end angles, in radians, for the revolution
close If true, the first and the last rotated revolution profiles will be connected to form a closed tube


PolygonMesh.addShell! ( in Scalar thickness )

Adds a shell to the object (solidify), by copying the surface and connecting all border polygons. The current surface will be pushed by 1/2 thickness along the point normals, and the copied surface (interior) will be pushed by the same amount in the opposite direction.

注釈

This simple implementation is not copying attribute values to the interior surface, and is not treating self-intersections.


PolygonMesh.beginStructureChanges! ()

Signals the beginning of structural changes for the polygon mesh, like adding or removing polygons. Some methods, such as PolygonMesh.addPolygon and PolygonMesh.deletePolygon, need to be called between PolygonMesh.beginStructureChanges and PolygonMesh.endStructureChanges brackets. See メッシュ構造の変更 for more details.

注釈

The PolygonMeshStructureChangeBracket wraps a being/endStructureChanges using its constructor and destructor, which can reduce unbalanced bracket errors.

注釈

Structure change brackets can be nested, in which case only the outer PolygonMesh.endStructureChanges will compile the changes.


PolygonMesh.deletePolygon! ( in Size polygonIndex, in Boolean deleteUnusedPoints, in Boolean reorderPoints )

Deletes a polygon, and optionally the connected points that are no longer used due to this deletion. This polygon will be marked as deleted, and its index will be reused only after the last PolygonMesh.endStructureChanges bracket closes (see 削除されたコンポーネントインデックス群の置換).

deleteUnusedPoints If true, points that were only adjacent to this polygon will be deleted too.
reorderPoints If true, point polygons’ ordering will be updated for the adjacent points, else it will be delayed (see 頂点の順序付けを遅らせる)


PolygonMesh.endStructureChanges! ()

Marks the ends structural changes for the polygon mesh, like adding or removing polygons. Some methods, such as PolygonMesh.addPolygon and PolygonMesh.deletePolygon, need to be made between calls to PolygonMesh.beginStructureChanges and PolygonMesh.endStructureChanges. See メッシュ構造の変更 for more details.

注釈

The PolygonMeshStructureChangeBracket wraps a being/endStructureChanges using its constructor and destructor, which can reduce unbalanced bracket errors.

注釈

Structure change brackets can be nested, in which case only the outer PolygonMesh.endStructureChanges will compile the changes.


PolygonMesh.extrudeLines! ( in Lines lines, in UInt32 subdiv, in Scalar thickness, in Vec3 upvector, out Xfo transforms[] )

Extrudes a circular profile along a Lines object.


PolygonMesh.invertPolygon! ( in Size polygonIndex )

Inverts a polygon, such that a polygon defined by polygonPoints [A, B, ..., N] will be defined by [N, ..., B, A]. Attributes remain attached to the same polygon points.


PolygonMesh.invertPolygons! ()

Inverts all polygons, such that a polygons defined by polygonPoints [A, B, ..., N] will be defined by [N, ..., B, A]. Attributes remain attached to the same polygon points.


Boolean PolygonMesh.isPointDeleted? ( in Size point )

Returns true if a point has been deleted (before it is replaced at last PolygonMesh.endStructureChanges).


Boolean PolygonMesh.isPolygonDeleted? ( in Size polygon )

Returns true if a polygon has been deleted (before it is replaced at last PolygonMesh.endStructureChanges).


PolygonMesh.linearSubdividePolygons! ( in Size polygons[], io Size firstEdgePoint, io Size firstCenterPoint )

Subdivides the polygons linearly. Each polygon edge will be subdivided in two equal portions, and the created middle points will be joined to a new central point for each polygon.

注釈

polygons must contain no duplicates

polygons Polygons to be subdivided
firstEdgePoint First index of the points created by splitting the edges (indices from firsEdgePoint to firstCenterPoint-1)
firstCenterPoint First index of the center points (count = polygons.size())


PolygonMesh.mergeMesh! ( in Ref<PolygonMesh> source )

Appends a mesh to this one, including its attributes.

注釈

If some the source mesh defines attributes that this mesh doesn’t have, these will be added to this mesh’s attribute set. If meshes have some attributes of the same name, with different types, an error will be thrown.


PolygonMesh.mergeMeshClones! ( in Ref<PolygonMesh> source, in Xfo transformXfos[], in Boolean transformNormals )

Appends multiple transformed copies of a same polygon meshes to this one, including its attributes.

注釈

If some the source mesh defines attributes that this mesh doesn’t have, these will be added to this mesh’s attribute set. If meshes have some attributes of the same name, with different types, an error will be thrown.

source Mesh to be appended
transformXfos Transforms to be applied for each copy of the source mesh
transformNormals If true, normals of the source meshes will be transformed with transformXfos


PolygonMesh.mergeMeshes! ( in PolygonMesh sources[], in Xfo transformXfos[], in Boolean transformNormals )

Appends multiple transformed polygon meshes to this one, including their attributes.

注釈

If some of the source meshes define attributes that this mesh doesn’t have, these will be added to this mesh’s attribute set. If meshes have some attributes of the same name, with different types, an error will be thrown.

sources Meshes to be appended
transformXfos Transforms to be applied for each source mesh
transformNormals If true, normals of the source meshes will be transformed with transformXfos


PolygonMesh.mergeMeshes! ( in PolygonMesh sources[], in Xfo transformXfos[], in Boolean transformNormals, in Boolean setupMaterialIDs )

Appends multiple transformed polygon meshes to this one, including their attributes.

注釈

If some of the source meshes define attributes that this mesh doesn’t have, these will be added to this mesh’s attribute set. If meshes have some attributes of the same name, with different types, an error will be thrown.

sources Meshes to be appended
transformXfos Transforms to be applied for each source mesh
transformNormals If true, normals of the source meshes will be transformed with transformXfos
setupMaterialIDs If true, the materialID IntegerAttribute will be setup and filled with ids per source mesh.


PolygonMesh.mergeMeshes! ( in PolygonMesh sources[], io Size firstPoints[], io Size firstPolygons[] )

Appends multiple polygon meshes to this one, including their attributes.

注釈

If some of the source meshes define attributes that this mesh doesn’t have, these will be added to this mesh’s attribute set. If meshes have some attributes of the same name, with different types, an error will be thrown.

sources Meshes to be appended
firstPoints First index of the points appended for a specific source mesh
firstPolygons First index of the polygons appended for a specific source mesh


PolygonMesh.mergePoints! ( in Size firstPointToDelete, in Size secondPoint, in Scalar attributeFirstToSecondRatio, in Boolean deleteOtherUnusedPoints, in Boolean reorderPoints )

Merges two points into one, deleting firstPointToDelete. Polygons that were connected to firstPointToDelete will be reconnected to secondPoint. If the points were connected through edge(s), these will be collapsed.

Attribute values will be merged and averaged according to attributeFirstToSecondRatio if values are continuous relatively to each collapsed edge. Discontinuities will be preserved for all attributes, even if their configuration differs among attributes.

注釈

An exceptional case is when the points are adjacent to a same polygon, but not through an edge. In this case, the polygon will be split, creating a new polygon.

firstPointToDelete First of the two points to merge. This one will be deleted.
secondPoint Second of the two points to merge. This one will be augmented with polygons of firstPointToDelete.
attributeFirstToSecondRatio Ratio for merging attribute values, including positions. 0.0 corresponds to firstPointToDelete, 0.0 corresponds to secondPoint, and values in-between are accepted.
deleteOtherUnusedPoints Will delete points that no longer have polygons. In some situations, this might include secondPoint or other adjacent points (eg: single triangle).
reorderPoints Will force an immediate reordering of the points modified by the operation, but will cause some overhead. This includes secondPoint but can include other adjacent points.


PolygonMesh.splitEdge! ( in PolygonMeshEdge edge, in Scalar attributeSplitRatio, out Size newPointIndex, out PolygonMeshEdge newEdge )

Splits the edge by adding a point between its start and end points. Attribute values for the new point will be interpolated based on the attributeSplitRatio.

edge Edge to be split
attributeSplitRatio The split ratio for the inserted point and attribute, with 0 corresponding to polygonPointIndex and 1 correponding to the next polygon point index
newPointIndex The new point created between the previous start and end points of edge
newEdge The created edge, which correponds to the end portion of the split edge


Size PolygonMesh.splitEdge! ( in Size polygon, in Size polygonPointIndex, in Scalar attributeSplitRatio )

Splits a polygon edge by adding a new polygon point. The created point index is returned. The new point is inserted at polygon index polygonPointIndex+1. Attribute values for the new point will be interpolated based on the attributeSplitRatio.

polygon Index of the polygon
polygonPointIndex Index of the first point forming the edge to be split (in polygon point order), in the [0 .. PolygonMesh.getPolygonSize -1] range
attributeSplitRatio The split ratio for the inserted point and attribute, with 0 corresponding to polygonPointIndex and 1 correponding to the next polygon point index


PolygonMesh[] PolygonMesh.splitMeshIntoChunks? ( in UInt32 chunkSizeLimit )

Splits the mesh up in multiple mesh pieces based on a limit on split vertices. So for example for a cube the split vertices count is 24 and not 6, since each vertex has to be split based on the normals for each corner. This function uses an algorithm which grows polygon islands based on neighbor information.


PolygonMesh.splitPolygon! ( in Size polygon, in Size polygonPointIndex1, in Size polygonPointIndex2, out Size newPolygon, out Size newPolygonEdgeStartPointIndex )

Splits a polygon in two by adding an edge between polygon point indices polygonPointIndex1 and polygonPointIndex2. The created polygon needs to have at least 3 sides, so polygonPointIndex1 and polygonPointIndex2 cannot be consecutive indices. The index of the added polygon is returned.

After the operation, the existing polygon will have points polygonPointIndex2 to polygonPointIndex1, and the created polygon will have points polygonPointIndex1 to polygonPointIndex2. Attribute values will be properly preserved for both polygons.

polygon The polygon to be split
polygonPointIndex1 first polygon point for the added edge, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
polygonPointIndex2 second polygon point for the added edge, in the [0 .. PolygonMesh.getPointPolygonCount -1] range


PolygonMesh.splitPolygon! ( in Size polygonIndex, in Size point1, in Size point2, out Size newPolygonIndex, out PolygonMeshEdge newEdge )

Splits a polygon in two by adding an edge between polygon points point1 and point2. The created polygon needs to have at least 3 sides, so point1 and point2 cannot be consecutive within that polygon. The created edge and the index of the added polygon are returned.

After the operation, the existing polygon will have points point2 to point1, and the created polygon will have points point1 to point2. Attribute values will be properly preserved for both polygons.

polygon The polygon to be split
point1 the first point for the added edge, needs to be connected to polygon
point2 the second point for the added edge, needs to be connected to polygon
newPolygonIndex the index of the created polygon
newEdge the created edge, adjacent to polygon and newPolygonIndex


PolygonMesh.updatePointPolygonOrder! ( in Size point )

Forces an update of point’s polygon ordering if required. See 頂点の順序付けを遅らせる for more about point polygon ordering.

注釈

The PolygonMesh maintains flags for unordered points, so only potentially unordered points will be processed


PolygonMesh.updatePointsPolygonOrder! ()

Forces an update of point polygon ordering for all points that need it. See 頂点の順序付けを遅らせる for more about point polygon ordering.

注釈

The PolygonMesh maintains flags for unordered points, so only potentially unordered points will be processed


Normals methods

Vec3 PolygonMesh.generatePolygonNormal? ( in Size polygon )

Computes and returns the polygon normal. This is a geometric computation that doesn’t take into account stored point normals. It returns the normalized sum of cross products of polygon’s first point with all edges (area vector).

注釈

the polygon normal is not cached by the PolygonMesh, and will be recomputed at each call.


Ref<Vec3Attribute> PolygonMesh.getNormals? ()

Returns the normals attribute, if it exists.


Ref<Vec3Attribute> PolygonMesh.getOrCreateNormals! ()

Returns the normals attribute, and creates it if it didn’t exist.


Vec3 PolygonMesh.getPointNormal? ( in Size point )

Returns the stored normal for the point

注釈

It might happen that normals around the point are split (unshared), in which case an arbitrary one will be returned. See ポリゴンメッシュアトリビュート for more information about attribute sharing.


Vec3 PolygonMesh.getPointNormal? ( in Size point, in Size neighborPolygonIndex )

Returns the stored normal of the point, at a specific neighbor index.

注釈

This is equivalent to PolygonMesh.getPolygonPointNormal, but done relative to the point.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range


Vec3 PolygonMesh.getPolygonPointNormal? ( in Size polygon, in Size polygonPointIndex )

Returns the stored normal at a polygon point.

注釈

This is equivalent to PolygonMesh.getPointNormal ( Size point, Size neighborPolygonIndex ), but done relative to the polygon.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.


PolygonMesh.incrementNormalsVersion! ()

Helper for incrementing the version of the normals attribute after value changes. See Attribute versioning for more information.


PolygonMesh.recomputePointNormals! ( in Scalar hardAngleRadians )

Recomputes all point normals and introduces normal splits if adjacent polygons’ normals differ by more than hardAngleRadians radians. All previously stored point normals will be overwritten. The computed normal value is the average of neighbor polygons’ PolygonMesh.generatePolygonNormal (or a subset of these if there is a split).


PolygonMesh.recomputePointNormals! ()

Recomputes all point normals. All previously stored point normals will be overwritten. The computed normal value is the average of neighbor polygons’ PolygonMesh.generatePolygonNormal.

注釈

Normals will usually will be shared per point, unless there are multiple wings, in which case there might be one distinct normal per wing (see ボーダーとウィング).


PolygonMesh.recomputePointNormalsIfRequired! ( in Scalar hardAngleRadians )

バージョン 1.13.0 で追加.

Same as PolygonMesh.recomputePointNormals, but will do nothing if point positions’ version didn’t change since last call (see Attribute versioning).


PolygonMesh.recomputePointNormalsIfRequired! ()

バージョン 1.13.0 で追加.

Same as PolygonMesh.recomputePointNormals, but will do nothing if point positions didn’t change since last call.


PolygonMesh.setPointNormal! ( in Size point, in Size neighborPolygonIndex, in Vec3 normal )

Sets the normal for a point, at a specific neighbor index.

注釈

This is equivalent to PolygonMesh.setPolygonPointNormal, but done relative to the point.

注釈

An attribute split will occur if the value differs from another neighbor polygon. See ポリゴンメッシュアトリビュート for more information about attribute sharing.

注釈

Once normals have been set, call PolygonMesh.incrementNormalsVersion (see Attribute versioning)


PolygonMesh.setPointNormal! ( in Size point, in Vec3 normal )

Sets a normal for a point (uniform / shared).

注釈

This will set the normal for all neighbor polygons even if the normal was previously split (unshared)

注釈

Once normals have been set, call PolygonMesh.incrementNormalsVersion (see Attribute versioning)

注釈

This function is threadsafe if the mesh structure and attribute sharing layout is not modified by another thread.


PolygonMesh.setPolygonPointNormal! ( in Size polygon, in Size polygonPointIndex, in Vec3 normal )

Sets the normal at a specific polygon point.

注釈

This is equivalent to PolygonMesh.setPointNormal ( Size point, Size neighborPolygonIndex, Vec3 normal ), but done relative to the polygon.

注釈

An attribute split will occur if the value differs from another neighbor polygon. See ポリゴンメッシュアトリビュート for more information about attribute sharing.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.


Point methods

PolygonMesh.getPointBorderInfo? ( in Size point, in Size neighborPolygonIndex, out Boolean precededByBorder, out Boolean atClosedWingStart )

For a point neighbor polygon, returns border and wing information (see ボーダーとウィング for definitions and an example of usage)

注釈

An exception will be thrown if point polygons are unordered (see 頂点の順序付けを遅らせる)

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
precededByBorder True if the neighbor polygon is preceded by a border (in counter-clockwise order)
atClosedWingStart True if the neighbor polygon is the first of a closed wing (see ボーダーとウィング)


Size PolygonMesh.getPointNextNeighborPolygonIndexInWing? ( in Size point, in Size neighborPolygonIndex )

Returns points’s next neighborPolygonIndex in the wing. This follows polygon adjacency around the point:

  • closed wings will be treated as a circular array (next of wing’s end index is wing’s start index)
  • at open wing’s end (border), returned value will be InvalidIndex

The returned neighborPolygonIndex is in the [0 .. PolygonMesh.getPointPolygonCount -1] range, or InvalidIndex if neighborPolygonIndex is before a border.

See ボーダーとウィング for definitions and an example of usage.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range


Size PolygonMesh.getPointPolygon? ( in Size point, in Size neighborPolygonIndex )

Returns the connected polygon at a specific neighborPolygonIndex.

注釈

An exception will be thrown if point polygons are unordered (see 頂点の順序付けを遅らせる)


PolygonMesh.getPointPolygonAndIndex? ( in Size point, in Size neighborPolygonIndex, out Size polygon, out Size polygonPointIndex )

For a point and a specific neighborPolygonIndex, returns the polygon and associated polygonPointIndex

注釈

An exception will be thrown if point polygons are unordered (see 頂点の順序付けを遅らせる)

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
polygon Index of the connected polygon
polygonPointIndex Index of this point within polygon’s points, in the [0 .. PolygonMesh.getPolygonSize -1] range


Size PolygonMesh.getPointPolygonCount? ( in Size point )

Returns the number of polygons connected to that point (neighbor polygons).


PolygonMesh.getPointPolygonFullBorderInfo? ( in Size point, in Size neighborPolygonIndex, out Size wingPolygonPointIndexBegin, out Size wingPolygonPointIndexEnd, out Boolean isClosedWing )

For a point neighbor polygon, returns the start and end neighbor indices of its containing wing, and if that wing is closed (see ボーダーとウィング for definitions and an example of usage)

注釈

An exception will be thrown if point polygons are unordered (see 頂点の順序付けを遅らせる)

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range
wingPolygonPointIndexBegin neighborPolygonIndex of the first polygon of the wing
wingPolygonPointIndexEnd End neighborPolygonIndex for the wing (wing contains neighbors wingPolygonPointIndexBegin to wingPolygonPointIndexEnd-1)
isClosedWing True if the wing is closed (contains no border)


PolygonMesh.getPointPolygons? ( in Size point, out LocalL8UInt32Array polygons )

For a point, returns all adjacent polygons, in neighbor order (by neighborPolygonIndex).

注釈

Neighbor polygons are always in adjacency and wing order (see ボーダーとウィング)

注釈

An exception will be thrown if point polygons are unordered (see 頂点の順序付けを遅らせる)


PolygonMesh.getPointPolygonsAndIndices? ( in Size point, out LocalL8UInt32Array polygons, out LocalL8UInt32Array polygonPointIndices )

For a point, returns all adjacent polygons and their associated polygonPointIndex, in neighbor order (by neighborPolygonIndex).

注釈

Neighbor polygons are always in adjacency and wing order (see ボーダーとウィング)

注釈

An exception will be thrown if point polygons are unordered (see 頂点の順序付けを遅らせる)

point Point index
polygons Indices of the adjacent polygons
polygonPointIndices Indices of this point within polygon’s points, in the [0 .. PolygonMesh.getPolygonSize -1] range


PolygonMesh.getPointPolygonsBorderInfo! ( in Size point, out LocalL8UInt32Array neighborPolygonsInfo )

Equivalent to PolygonMesh.getPointBorderInfo, where all neighbor polygon border and wing information is packed in the neighborPolygonsInfo array. The neighborPolygonsInfo will have a size of PolygonMesh.getPointPolygonCount.

For each neighbor value (UInt32):

  • if the PolygonMesh_precededByBorder bit is set, the neighbor polygon is preceded by a border
  • if the PolygonMesh_atClosedWingStart bit is set, the neighbor is the first polygon of a closed wing

注釈

Calling this function is faster than calling PolygonMesh.getPointBorderInfo for each neighbor.


Vec3 PolygonMesh.getPointPosition? ( in Size point )

Returns the position of the point in single precision.

注釈

If positions are stored as Vec3_d (Float64), a conversion will be applied.


Vec3_d PolygonMesh.getPointPosition_d? ( in Size point )

Returns the position of the point in double precision (Float64).

注釈

If positions are stored as Vec3 (Float32), a conversion will be applied.


Size PolygonMesh.getPointPrevNeighborPolygonIndexInWing? ( in Size point, in Size neighborPolygonIndex )

Returns points’s previous neighborPolygonIndex in the wing. This follows polygon adjacency around the point:

  • closed wings will be treated as a circular array (previous of wing’s start index is wing’s end index)
  • at open wing’s start (border), returned value will be InvalidIndex

The returned neighborPolygonIndex is in the [0 .. PolygonMesh.getPointPolygonCount -1] range, or InvalidIndex if neighborPolygonIndex is after a border.

See ボーダーとウィング for definitions and an example of usage.

point Point index
neighborPolygonIndex Neighbor polygon index, in the [0 .. PolygonMesh.getPointPolygonCount -1] range


PolygonMesh.getPointSurroundingPoints? ( in Size point, in Boolean includeAllPolygonPoints, out LocalL16UInt32Array surroundingPoints )

Returns all adjacent points, in counter clockwise order (neighbor order). For the example below, you can refer to the 2X2 grid component figure presented in ポリゴンメッシュ .

注釈

Even if includeAllPolygonPoints is false, the number of returned points will be more than PolygonMesh.getPointPolygonCount if there are some borders (see ボーダーとウィング).

point Point index
includeAllPolygonPoints Option to include other non-adjacent points of the connected polygons (contour points of the polygon ring).
surroundingPoints Array containing the resulting adjacent points.
/*
** Example: getPointSurroundingPoints
*/

require Geometry;
  
operator entry() {

      PolygonMesh p();
      p.addPlane(Xfo(), 2.0, 2.0, 2, 2);
      
      LocalL16UInt32Array surroundingPoints;
      p.getPointSurroundingPoints(1, false, surroundingPoints);
      report("Connected surrounding points: " + surroundingPoints.getString() );
      
      p.getPointSurroundingPoints(1, true, surroundingPoints);
      report("Connected surrounding points, including other polygon points: " + surroundingPoints.getString() );
  
}

/*
** Output:

Connected surrounding points: [0, 4, 2]
Connected surrounding points, including other polygon points: [0, 3, 4, 5, 2]

*/


Size PolygonMesh.pointCount? ()

Returns the number of points.

注釈

If within a PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges bracket, this count will include any point that were deleted within this bracket, in which case PolygonMesh.isPointDeleted will return true (see メッシュ構造の変更).


PolygonMesh.setPointPosition! ( in Size point, in Vec3 value )

Sets the position of the point.

注釈

Once point positions have been set, call PolygonMesh.incrementPointPositionsVersion (see Attribute versioning)

注釈

If positions are stored as Vec3_d (Float64), a conversion will be applied.

参考

PolygonMesh.hasFloat64Positions, PolygonMesh.setPointPosition( Size, Vec3_d )


PolygonMesh.setPointPosition! ( in Size point, in Vec3_d value )

Sets the position of the point in double precision (Float64).

注釈

If positions are stored as Vec3 (Float32), a conversion will be applied.

注釈

Once point positions have been set, call PolygonMesh.incrementPointPositionsVersion (see Attribute versioning)

参考

PolygonMesh.hasFloat64Positions, PolygonMesh.setPointPosition( Size, Vec3 )


Polygon methods

LocalBoundingVolume PolygonMesh.computePolygonBBox? ( in Size polygon )

Computes and returns the bounding box of a polygon.


Size PolygonMesh.getPolygonAdjacentPolygon? ( in Size polygon, in Size polygonPointIndex )

Returns polygon’s adjacent polygon, at the polygon edge formed by polygon point indices polygonPointIndex and PolygonMesh.nextPolygonPointIndex (polygonPointIndex). If that edge is a border, there is no adjacent polygon, and InvalidIndex will be returned.

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.


PolygonMesh.getPolygonAdjacentPolygonAndIndex? ( in Size polygon, in Size polygonPointIndex, io Size adjacentPolygon, io Size adjacentPolygonPointIndex )

Returns polygon’s adjacent polygon, at the polygon edge formed by polygon point indices polygonPointIndex and PolygonMesh.nextPolygonPointIndex (polygonPointIndex).

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.
adjacentPolygon Adjacent polygon index. If the edge is a border, there is no adjacent polygon, and InvalidIndex will be returned.
adjacentPolygonPointIndex Edge’s first polygonPointIndex relative to the adjacent polygon.


Size PolygonMesh.getPolygonSize? ( in Size polygon )

Returns the size of the polygon, which is number of points connected to this polygon (== the polygonPointIndex range for this polygon)


Boolean PolygonMesh.isPolygonBorder? ( in Size polygon, in Size polygonPointIndex )

Returns true if the polygon has a border (no adjacent polygon) at the polygon edge formed by polygon point indices polygonPointIndex and PolygonMesh.nextPolygonPointIndex (polygonPointIndex).

polygon Polygon index
polygonPointIndex Polygon point index, in the [0 .. PolygonMesh.getPolygonSize -1] range.


Size PolygonMesh.polygonCount? ()

Returns the number of polygons.

注釈

If within a PolygonMesh.beginStructureChanges / PolygonMesh.endStructureChanges bracket, this count will include any polygon that were deleted within this bracket, in which case PolygonMesh.isPolygonDeleted will return true (see メッシュ構造の変更).


Size PolygonMesh.polygonPointsCount? ()

Returns the sum of all polygon points of the PolygonMesh.

注釈

This sum is cached, so no traversal of the polygons will be required.


Primitives methods

PolygonMesh.addCone! ( in Xfo xfo, in Scalar radius, in Scalar height, in Boolean cap, in Size detail )

Appends a transformed cone to this mesh, with no normals nor UVs. Before applying the transformation, cone’s base is centered at Y = -height / 2, and the tip will be at Y = height / 2.

xfo Created points will be transformed by this Xfo
radius Radius of cone’s base
height Height of the cone
cap If true, a disc will be added at the base of the cone
detail Number of cone sides - 3


PolygonMesh.addCone! ( in Xfo xfo, in Scalar radius, in Scalar height, in Boolean cap, in Size detail, in Boolean setNormals, in Boolean setUVs )

Appends a transformed cone to this mesh. Before applying the transformation, cone’s base will be centered at Y = -height / 2, and the tip will be at Y = height / 2.

xfo Created points will be transformed by this Xfo
radius Radius of cone’s base
height Height of the cone
cap If true, a disc will be added at the base of the cone
detail Number of cone sides - 3
setNormals If true, point normals will be set
setUVs If true, some UVs will be set in the uvs0 attribute


PolygonMesh.addCube! ( in Xfo xfo, in Scalar x, in Scalar y, in Scalar z )

See PolygonMesh.addCuboid


PolygonMesh.addCuboid! ( in Xfo xfo, in Scalar x, in Scalar y, in Scalar z )

Appends a transformed cuboid (cube with specified size) to this mesh. Before applying the transformation, the cuboid is centered at the origin, and has a range of [-x/2 .. x/2, -y/2 .. y/2, -z/2 .. z/2].

xfo Created points will be transformed by this Xfo
x Length of the cube, in x
y Length of the cube, in y
z Length of the cube, in z


PolygonMesh.addCuboid! ( in Xfo xfo, in Scalar x, in Scalar y, in Scalar z, in Boolean setNormals, in Boolean setUVs )

Appends a transformed cuboid (cube with specified size) to this mesh. Before applying the transformation, the cuboid is centered at the origin, and has a range of [-x/2 .. x/2, -y/2 .. y/2, -z/2 .. z/2].

xfo Created points will be transformed by this Xfo
x Length of the cube, in x
y Length of the cube, in y
z Length of the cube, in z
setNormals If true, point normals will be set
setUVs If true, some UVs will be set in the uvs0 attribute


PolygonMesh.addCylinder! ( in Xfo xfo, in Scalar radius, in Scalar height, in Boolean caps, in Integer sides, in Integer loops )

Appends a transformed cylinder to this mesh, with no normals nor UVs. Before applying the transformation, the base will be centered at Y = -height / 2, and its top will be at Y = height / 2.

xfo Created points will be transformed by this Xfo
radius Radius of the cylinder
height Height of the cylinder
caps If true, a disc will be added at the base and the top of the cylinder (closed)
sides Number of cylinder sides
loops Number of cylinder loops along its height


PolygonMesh.addCylinder! ( in Xfo xfo, in Scalar radius, in Scalar height, in Boolean caps, in Integer sides, in Integer loops, in Boolean setNormals, in Boolean setUVs )

Appends a transformed cylinder to this mesh. Before applying the transformation, the base will be centered at Y = -height / 2, and its top will be at Y = height / 2.

xfo Created points will be transformed by this Xfo
radius Radius of the cylinder
height Height of the cylinder
caps If true, a disc will be added at the base and the top of the cylinder (closed)
sides Number of cylinder sides
loops Number of cylinder loops along its height
setNormals If true, point normals will be set
setUVs If true, some UVs will be set in the uvs0 attribute


PolygonMesh.addDisc! ( in Xfo xfo, in Scalar radius, in Scalar arcAngle, in Size detail, in Boolean setNormals, in Boolean setUVs )

Appends a transformed disc to this mesh.

xfo Created points will be transformed by this Xfo
radius Radius of the disc
arcAngle Disc portion (pie), in radians (full disc = TWO_PI)
detail Number of disc sides - 3
setNormals If true, point normals will be set
setUVs If true, some UVs will be set in the uvs0 attribute


PolygonMesh.addPlane! ( in Xfo xfo, in Scalar length, in Scalar width, in Size lengthSections, in Size widthSections )

Appends a transformed plane to this mesh, with no normals nor UVs. Before applying the transformation, it will be in the XZ plane, centered at the origin.

xfo Created points will be transformed by this Xfo
length Length of the plane (in Z)
width Width of the plane (in X)
lengthSections Number of polygon rows along the length
widthSections Number of polygon rows along the width


PolygonMesh.addPlane! ( in Xfo xfo, in Scalar length, in Scalar width, in Size lengthSections, in Size widthSections, in Boolean setNormals, in Boolean setUVs )

Appends a transformed plane to this mesh. Before applying the transformation, it will be in the XZ plane, centered at the origin.

xfo Created points will be transformed by this Xfo
length Length of the plane (in Z)
width Width of the plane (in X)
lengthSections Number of polygon rows along the length
widthSections Number of polygon rows along the width
setNormals If true, point normals will be set
setUVs If true, some UVs will be set in the uvs0 attribute


PolygonMesh.addSphere! ( in Xfo xfo, in Scalar radius, in Size detail )

Appends a transformed sphere to this mesh, with no normals nor UVs. Before applying the transformation, it will be centered at the origin.

xfo Created points will be transformed by this Xfo
radius Radius of the sphere
detail Increasing this number will add more sections to the sphere


PolygonMesh.addSphere! ( in Xfo xfo, in Scalar radius, in UInt32 detail, in Boolean setNormals, in Boolean setUVs )

Appends a transformed sphere to this mesh. Before applying the transformation, it will be centered at the origin.

xfo Created points will be transformed by this Xfo
radius Radius of the sphere
detail Increasing this number will add more sections to the sphere
setNormals If true, point normals will be set
setUVs If true, some UVs will be set in the uvs0 attribute


PolygonMesh.addSphere! ( in Xfo xfo, in Scalar radius, in UInt32 loops, in UInt32 sides, in Boolean setNormals, in Boolean setUVs )

Appends a transformed sphere to this mesh. Before applying the transformation, it will be centered at the origin.

xfo Created points will be transformed by this Xfo
radius Radius of the sphere
loops The number of latitudinal loops of the sphere
sides The number of longitudinal sides of the sphere
setNormals If true, point normals will be set
setUVs If true, some UVs will be set in the uvs0 attribute


PolygonMesh.addTeapot! ( in Xfo xfo, in Scalar size, in Integer detail )

Appends a transformed teapot to this mesh, with normals and UVs. Before applying the transformation, it will be centered at the origin.

xfo Created points will be transformed by this Xfo
size A size multiplier for the teapot
detail Increasing this number will add more sections to the teapot


PolygonMesh.addTorus! ( in Xfo xfo, in Scalar innerRadius, in Scalar outerRadius, in Size detail )

Appends a transformed torus to this mesh, with no normals nor UVs. Before applying the transformation, it will be in the XZ plane, centered at the origin.

xfo Created points will be transformed by this Xfo
innerRadius The radius of torus’s central hole
outerRadius The radius of the torus’s outer ring (height = outerRadius - innerRadius)
detail Increasing this number will add sections to the torus


PolygonMesh.addTorus! ( in Xfo xfo, in Scalar innerRadius, in Scalar outerRadius, in Size detail, in Boolean setNormals, in Boolean setUVs )

Appends a transformed torus to this mesh. Before applying the transformation, it will be in the XZ plane, centered at the origin.

xfo Created points will be transformed by this Xfo
innerRadius The radius of torus’s central hole
outerRadius The radius of the torus’s outer ring (height = outerRadius - innerRadius)
detail Increasing this number will add sections to the torus
setNormals If true, point normals will be set
setUVs If true, some UVs will be set in the uvs0 attribute


PolygonMesh.drawBone! ( in Xfo xfo, in Scalar length, in Scalar radius, in Boolean setNormals )

Appends a transformed bone primitive to this mesh. Before applying the transformation, its length is in the +X axis, starting from the origin.

xfo Created points will be transformed by this Xfo
length Length of the bone
radius Radius of the bone (Y and Z radius)
setNormals If true, normals will be added (faceted)


Tangents methods

PolygonMesh.recomputeTangents! ()

Computes tangents for shading, based on normals and uvs attributes.


PolygonMesh.recomputeTangentsIfRequired! ()

バージョン 1.13.0 で追加.

Computes tangents for shading, based on normals and uvs attributes. Will recompute only if attribute version of normals or uvs has changed (see Attribute versioning).


Triangles methods

UInt32[] PolygonMesh.generateAttributesTriangleList? ()

Generates a packed list of triangle attributeIndex triplets, for rendering directly into the GeometryAttributes buffers (eg: OpenGL). An attributeIndex is not a point index, and this is true as soon there is at least one attribute value split for any attribute.

The generated list has the following layout, where polygon triangles form index triplets: See ポリゴンメッシュアトリビュート for detailed information about attribute indices.

注釈

A current limitation is that all polygons will be triangulated as a simple triangle fan, where triangles’ polygonPointIndex = [0, 1, 2], [ 0, 2, 3], ..., [0, N-2, N-1]

[
  Polygon0_Triangle0_attributeIndex0, Polygon0_Triangle0_attributeIndex1, Polygon0_Triangle0_attributeIndex2, 
  Polygon0_Triangle1_attributeIndex0, Polygon0_Triangle1_attributeIndex1, Polygon0_Triangle1_attributeIndex2,
  Polygon1_Triangle0_attributeIndex0, Polygon0_Triangle0_attributeIndex1, Polygon0_Triangle0_attributeIndex2...
]


UInt32[] PolygonMesh.generateTriangleList? ()

Generates a packed list of triangle point triplets.

The generated list has the following layout, where polygon triangles form index triplets:

注釈

point indices are not the same as attribute indices; see ポリゴンメッシュアトリビュート for more details.

注釈

A current limitation is that all polygons will be triangulated as a simple triangle fan, where triangles’ polygonPointIndex = [0, 1, 2], [ 0, 2, 3], ..., [0, N-2, N-1]

[
  Polygon0_Triangle0_point0, Polygon0_Triangle0_point1, Polygon0_Triangle0_point2, 
  Polygon0_Triangle1_point0, Polygon0_Triangle1_point1, Polygon0_Triangle1_point2,
  Polygon1_Triangle0_point0, Polygon0_Triangle0_point1, Polygon0_Triangle0_point2...
]


Size PolygonMesh.getPolygonSubTriangleCount? ( in Size polygon )

Returns the number of sub-triangles for a polygon.


UInt32[3] PolygonMesh.getPolygonSubTrianglePolygonPoints? ( in Size polygon, in Size subTriangleIndex )

Returns the polygonPoint indices for a given polygon and sub-triangle index. A polygon with N points has N-2 sub-triangles.

注釈

Currently, polygons are always triangulated as simple fans.


Size PolygonMesh.triangleCount? ()

Returns the total number of triangles in this mesh (a polygon of size N generates N-2 triangles).

注釈

This call uses cached values and doesn’t require to traverse all polygons