LinesModeling.kl¶
Types¶
Lines (object)¶
The Lines object implements a Geometry made of line segments. Each segment corresponds to attribute index pairs.
The Lines have a raycastThickness member that defines the lines’ thickness for bounding volume and SpatialQueryable methods.
注釈
For functions treating elements such as SpatialQuery.getElementsInBBox, an element corresponds to a line segment.
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). |
UInt32[] | indices | Point index pairs for segments |
Scalar | raycastThickness | Thickness to be used for SpatialQueryable methods |
/*
** Example: Lines
*/
require Geometry;
operator entry() {
//Create a XZ square
Lines lines = Lines();
lines.addPoints( 4 );
lines.setPointPosition( 0, Vec3(0,0,0) );
lines.setPointPosition( 1, Vec3(1,0,0) );
lines.setPointPosition( 2, Vec3(1,0,1) );
lines.setPointPosition( 3, Vec3(0,0,1) );
lines.addClosedLine( 0, 3 );
Size segmentCount = lines.lineCount();
for( Size i = 0; i < segmentCount; ++i ) {
Size startPoint, endPoint;
lines.getLineAttributeIndices( i, startPoint, endPoint );
report("Segment " + i + " from " + lines.getPointPosition(startPoint) + " to " + lines.getPointPosition(endPoint) );
}
}
/*
** Output:
Segment 0 from {x:+0.0,y:+0.0,z:+0.0} to {x:+1.0,y:+0.0,z:+0.0}
Segment 1 from {x:+1.0,y:+0.0,z:+0.0} to {x:+1.0,y:+0.0,z:+1.0}
Segment 2 from {x:+1.0,y:+0.0,z:+1.0} to {x:+0.0,y:+0.0,z:+1.0}
Segment 3 from {x:+0.0,y:+0.0,z:+1.0} to {x:+0.0,y:+0.0,z:+0.0}
*/
Methods¶
SpatialQueryable methods¶
Boolean | areGeometryLocationsEquivalent ? ( in GeometryLocation location0, in GeometryLocation location1 ) |
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[2], out Scalar weights[2] ) | |
Size | getLocationSegmentIndex ? ( in GeometryLocation location ) |
getLocationSegmentWeights ? ( in GeometryLocation location, out Scalar point0Weight, out Scalar point1Weight ) | |
prepareForSpatialQueries ? ( in Size approximateNumberOfQueries, in GenericValueContainer options ) | |
GeometryLocation | raycast ? ( in Ray ray, in Boolean doubleSided, in Scalar coneThreshold, in Scalar maxDistance ) |
removeSpatialQueryAcceleration ! () |
Primitives methods¶
addArc ! ( in Xfo xfo, in Scalar radius, in Vec2 angleMinMax, in Integer detail ) | |
addAxes ! ( in Xfo xfo, in Scalar size ) | |
addCapsule ! ( in Xfo xfo, in Scalar radius, in Scalar height, in Integer detail ) | |
addCircle ! ( in Xfo xfo, in Scalar radius, in Size detail ) | |
addCross ! ( in Xfo xfo, in Scalar size ) | |
addGrid ! ( in Xfo xfo, in Scalar sizeX, in Scalar sizeY, in Scalar sizeZ, in Integer numXsections, in Integer numYsections, in Integer numZsections ) | |
addRectangle ! ( in Xfo xfo, in Scalar length, in Scalar width ) | |
addSphere ! ( in Xfo xfo, in Scalar radius, in Size detail ) | |
drawBoundingBox ! ( in Xfo xfo, in Vec3 bboxmin, in Vec3 bboxmax ) | |
drawCameraDisplay ! ( in Scalar focalDistance, in Scalar fovY, in Size windowWidth, in Size windowHeight ) |