Coppelia Geometric Routines
Lua API Reference

All units, unless otherwise indicated, are specified in meters and radians. Note that mesh-, point cloud- and OC tree-handles mentioned in this reference have no direct relation with CoppeliaSim shape-, point cloud- and OC tree-handles: meshes, point cloud and octrees mentioned in this API reference are internal representations that are exclusively created, manipulated and destroyed with below API functions.
Below API functions are a sub-set of their C++ API counterpart.

simGeom.copyMesh

Description Duplicates a mesh object.
Synopsis number meshCopyHandle=simGeom.copyMesh(number meshHandle)
Arguments
meshHandle: the mesh object to duplicate.
Return value(s)
meshCopyHandle: the copy of the mesh object in case of success.
See also simGeom.createMesh

simGeom.copyOctree

Description Duplicates an OC-tree object.
Synopsis number octreeCopyHandle=simGeom.copyOctree(number octreeHandle)
Arguments
octreeHandle: the OC-tree object to duplicate.
Return value(s)
octreeCopyHandle: the handle of the duplicated OC-tree object.
See also

simGeom.copyPtcloud

Description Duplicates a point-cloud object.
Synopsis number ptcloudCopyHandle=simGeom.copyPtcloud(number ptcloudHandle)
Arguments
ptcloudHandle: the point-cloud object to duplicate.
Return value(s)
ptcloudCopyHandle: the handle of the duplicated point-cloud object.
See also

simGeom.createMesh

Description Creates a mesh object.
Synopsis number meshHandle=simGeom.createMesh(table vertices,table indices,table_3 meshOriginPos=nil,table_4 meshOriginQuat=nil,number triangleEdgeMaxLength=0.3,number maxTrianglesInBoundingBox=8)
Arguments
vertices: a table with the vertices of the mesh, expressed relative to the world origin.
indices: a table with the indices of the mesh.
meshOriginPos: the transformation frame position of the mesh. Can be omitted, in which case the frame of the mesh is located at the world origin.
meshOriginQuat: the transformation frame quaternion of the mesh. Can be omitted, in which case the frame of the mesh is oriented as the world reference frame.
triangleEdgeMaxLength: the maximum triangle size used internally for efficient calculations. A smaller size usually results in faster calculations, but larger calculation structures. Can be omitted.
maxTrianglesInBoundingBox: the maximum number of triangles in leaf bounding boxes, used internally for efficient calculations. A smaller value usually results in faster calculations, but larger calculation structures. Can be omitted.
Return value(s)
meshHandle: the handle to the mesh object in case of success.
See also simGeom.destroyMesh, simGeom.copyMesh, simGeom.createMeshFromSerializationData

simGeom.createMeshFromSerializationData

Description Creates a mesh object based on serialization data.
Synopsis number meshHandle=simGeom.createMeshFromSerializationData(string serializationData)
Arguments
serializationData: the serialization data previously generated with simGeom.getMeshSerializationData.
Return value(s)
meshHandle: the handle of the created mesh.
See also simGeom.getMeshSerializationData

simGeom.createOctreeFromColorPoints

Description Creates an OC-tree object from several points with individual colors and individual user data.
Synopsis number octreeHandle=simGeom.createOctreeFromColorPoints(table points,table_3 octreeOriginPos=nil,table_4 octreeOriginQuat=nil,number cellS=0.05,table rgbData=nil,table usrData=nil)
Arguments
points: a table with point data, expressed relative to the world origin.
octreeOriginPos: the transformation frame position of the OC-tree. Can be omitted, in which case the frame of the OC-tree is located at the world origin.
octreeOriginQuat: the transformation frame quaternion of the OC-tree. Can be omitted, in which case the frame orientation of the OC-tree is same as the world origin.
cellS: The desired OC-tree voxel size. Can be omitted.
rgbData: the RGB colors (0-255)of the various points (i.e. one color per point). Can be omitted.
usrData: the user data of the various points (i.e. one user data per point). Can be omitted.
Return value(s)
octreeHandle: the handle of the created OC-tree object.
See also simGeom.createOctreeFromPoints, simGeom.createOctreeFromMesh, simGeom.createOctreeFromOctree, simGeom.destroyOctree, simGeom.copyOctree, simGeom.createOctreeFromSerializationData

simGeom.createOctreeFromMesh

Description Creates an OC-tree object from a mesh object.
Synopsis number octreeHandle=simGeom.createOctreeFromMesh(number meshHandle,table_3 meshPos,table_4 meshQuat,table_3 octreeOriginPos=nil,table_4 octreeOriginQuat=nil,number cellS=0.05,table_3 rgbData=nil,number usrData=0)
Arguments
meshHandle: the mesh object.
meshPos: the position of the mesh object.
meshQuat: the quaternion of the mesh object.
octreeOriginPos: the transformation frame position of the OC-tree. Can be omitted, in which case the frame of the OC-tree is located at the world origin.
octreeOriginQuat: the transformation frame quaternion of the OC-tree. Can be omitted, in which case the frame orientation of the OC-tree is same as the world origin.
cellS: The desired OC-tree voxel size. Can be omitted.
rgbData: the RGB color (0-255) of the generated voxels. Can be omitted.
usrData: the user data of the generated voxels. Can be omitted.
Return value(s)
octreeHandle: the handle of the created OC-tree object.
See also simGeom.createOctreeFromPoints,simGeom.createOctreeFromColorPoints, simGeom.createOctreeFromOctree, simGeom.destroyOctree, simGeom.copyOctree, simGeom.createOctreeFromSerializationData

simGeom.createOctreeFromOctree

Description Creates an OC-tree object from another OC-tree object.
Synopsis number newOctreeHandle=simGeom.createOctreeFromOctree(number octreeHandle,table_3 octreepos,table_4 octreeQuat,table_3 newOctreeOriginPos=nil,table_4 newOctreeOriginQuat=nil,number newOctreeCellS=0.05,table_3 rgbData=nil,number usrData=0)
Arguments
octreeHandle: the handle to the OC-tree object.
octreePos: the position of the OC-tree object.
octreeQuat: the quaternion of the OC-tree object.
newOctreeOriginPos: the transformation frame position of the new OC-tree. Can be omitted, in which case the frame of the new OC-tree is located at the world origin.
newOctreeOriginQuat: the transformation frame quaternion of the new OC-tree. Can be omitted, in which case the frame orientation of the new OC-tree is same as the world origin.
newOctreeCellS: The desired OC-tree voxel size. Can be omitted.
rgbData: the RGB color (0-255) of the generated voxels. Can be omitted.
usrData: the user data of the generated voxels. Can be omitted.
Return value(s)
newOctreeHandle: the handle of the new OC-tree object.
See also simGeom.createOctreeFromPoints,simGeom.createOctreeFromColorPoints, simGeom.createOctreeFromMesh, simGeom.destroyOctree, simGeom.copyOctree, simGeom.createOctreeFromSerializationData

simGeom.createOctreeFromPoints

Description Creates an OC-tree object from several points.
Synopsis number octreeHandle=simGeom.createOctreeFromPoints(table points,table_3 octreeOriginPos=nil,table_4 octreeOriginQuat=nil,number cellS=0.05,table rgbData=nil,number usrData=0)
Arguments
points: an table with point data, expressed relative to the world origin.
octreeOriginPos: the transformation frame position of the OC-tree. Can be omitted, in which case the frame position of the OC-tree is located at the world origin.
octreeOriginQuat: the transformation frame quaternion of the OC-tree. Can be omitted, in which case the frame orientation of the OC-tree is same as the world origin.
cellS: The desired OC-tree voxel size. Can be omitted.
rgbData: the RGB color (0-255) of the generated voxels. Can be omitted.
usrData: the user data of the generated voxels. Can be omitted.
Return value(s)
octreeHandle: the handle of the created OC-tree object.
See also simGeom.createOctreeFromColorPoints, simGeom.createOctreeFromMesh, simGeom.createOctreeFromOctree, simGeom.destroyOctree, simGeom.copyOctree, simGeom.createOctreeFromSerializationData

simGeom.createOctreeFromSerializationData

Description Creates an OC-tree object based on serialization data.
Synopsis number octreeHandle=simGeom.createOctreeFromSerializationData(string serializationData)
Arguments
serializationData: the serialization data previously generated with simGeom.getOctreeSerializationData.
Return value(s)
octreeHandle: the handle to the created OC-tree object.
See also simGeom.getOctreeSerializationData

simGeom.createPtcloudFromColorPoints

Description Creates a point-cloud object from several points with individual colors.
Synopsis number ptcloudHandle=simGeom.createPtcloudFromColorPoints(table points,table_3 ptcloudOriginPos=nil,table_4 ptcloudOriginQuat=nil,number cellS=0.05,number maxPointCnt=20,table rgbData=nil,number proximityTol=0.005)
Arguments
points: a table with point data, expressed relative to the world origin.
ptcloudOriginPos: the transformation frame position of the point-cloud. Can be omitted, in which case the frame of the point-cloud is located at the world origin.
ptcloudOriginQuat: the transformation frame quaternion of the point-cloud. Can be omitted, in which case the frame orientation of the point-cloud is same as the world origin.
cellS: The desired voxel size of the underlying OC-tree. Can be omitted.
maxPointCnt: The maximum amount of points inside of a OC-tree voxel. Can be omitted.
rgbData: the RGB color (0-255) of the generated points. Specify one color per point. Can be omitted.
proximityTol: the distance tolerance to other points (i.e. point-point distances below the specified value are not permitted and points will be omitted). Can be omitted.
Return value(s)
ptcloudHandle: the handle to the created point-cloud object.
See also simGeom.createPtcloudFromPoints, simGeom.destroyPtcloud, simGeom.copyPtcloud, simGeom.createPtcloudFromSerializationData

simGeom.createPtcloudFromPoints

Description Creates a point-cloud object from several points.
Synopsis number ptcloudHandle=simGeom.createPtcloudFromPoints(table points,table_3 ptcloudOriginPos=nil,table_4 ptcloudOriginQuat=nil,number cellS=0.05,number maxPointCnt=20,table_3 rgbData=nil,number proximityTol=0.005)
Arguments
points: a table with point data, expressed relative to the world origin.
ptcloudOriginPos: the transformation frame position of the point-cloud. Can be omitted, in which case the frame of the point-cloud is located at the world origin.
ptcloudOriginQuat: the transformation frame quaternion of the point-cloud. Can be omitted, in which case the frame orientation of the point-cloud is same as the world origin.
cellS: The desired voxel size of the underlying OC-tree. Can be omitted.
maxPointCnt: The maximum amount of points inside of a OC-tree voxel. Can be omitted.
rgbData: the RGB color (0-255) of the generated points. Can be omitted.
proximityTol: the distance tolerance to other points (i.e. point-point distances below the specified value are not permitted and points will be omitted). Can be omitted.
Return value(s)
ptcloudHandle: the handle to the created point-cloud object.
See also simGeom.createPtcloudFromColorPoints, simGeom.destroyPtcloud, simGeom.copyPtcloud, simGeom.createPtcloudFromSerializationData

simGeom.createPtcloudFromSerializationData

Description Creates a point-cloud object based on serialization data.
Synopsis number ptcloudHandle=simGeom.createPtcloudFromSerializationData(string serializationData)
Arguments
serializationData: the serialization data previously generated with simGeom.getPtcloudSerializationData.
Return value(s)
ptcloudHandle: the handle of the created point-cloud.
See also simGeom.getPtcloudSerializationData

simGeom.destroyMesh

Description Destroys a mesh object.
Synopsis simGeom.destroyMesh(number meshHandle)
Arguments
meshHandle: the handle of the mesh object.
Return value(s)
See also simGeom.createMesh

simGeom.destroyOctree

Description Destroys an OC-tree object.
Synopsis simGeom.destroyOctree(number octreeHandle)
Arguments
octreeHandle: the handle of the OC-tree object.
Return value(s)
See also simGeom.createOctreeFromPoints

simGeom.destroyPtcloud

Description Destroys a point-cloud object.
Synopsis simGeom.destroyPtcloud(number ptcloudHandle)
Arguments
ptcloudHandle: the handle of the point-cloud object.
Return value(s)
See also simGeom.createPtcloudFromPoints

simGeom.getBoxBoxDistance

Description Computes the minimum distance between two cuboids.
Synopsis number distance,table_3 distSegPt1,table_3 distSegPt2=simGeom.getBoxBoxDistance(table_3 box1Pos,table_4 box1Quat,table_3 box1HalfSize,table_3 box2Pos,table_4 box2Quat,table_3 box2HalfSize,bool boxesAreSolid,bool altRoutine=false)
Arguments
box1Pos: the position of the first cuboid.
box1Quat: the quaternion of the first cuboid.
box1HalfSize: the half-size of the first cuboid.
box2Pos: the position of the second cuboid.
box2Quat: the quaternion of the second cuboid.
box2HalfSize: the half-size of the second cuboid.
boxesAreSolid: whether the two cuboids are solid. If true, then cuboid A being fully encompassed by cuboid B will always lead to a distance of zero between the two cuboids.
altRoutine: if true, an alternative calculation routine will be used. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities.
distSegPt1: the minimum distance point on the first cuboid.
distSegPt2: the minimum distance point on the second cuboid.
See also simGeom.getBoxTriangleDistance, simGeom.getBoxSegmentDistance, simGeom.getBoxPointDistance

simGeom.getBoxPointDistance

Description Computes the minimum distance between a cuboid and a point.
Synopsis number distance,table_3 boxDistSegPt=simGeom.getBoxPointDistance(table_3 boxPos,table_3 boxQuat,table_3 boxHalfSize,bool boxIsSolid,table_3 point)
Arguments
boxPos: the position of the cuboid.
boxQuat: the quaternion of the cuboid.
boxHalfSize: the half-size of the cuboid.
boxIsSolid: whether the cuboid is solid. If true, then the point being fully encompassed by the cuboid will always lead to a distance of zero.
point: position of the point.
Return value(s)
distance: the minimum distance between the two entities.
boxDistSegPt: the minimum distance point on the cuboid.
See also simGeom.getMeshPointDistance, simGeom.getOctreePointDistance, simGeom.getPtcloudPointDistance, simGeom.getBoxBoxDistance, simGeom.getBoxTriangleDistance, simGeom.getBoxSegmentDistance, simGeom.getTrianglePointDistance, simGeom.getSegmentPointDistance

simGeom.getBoxSegmentDistance

Description Computes the minimum distance between a cuboid and a segment.
Synopsis number distance,table_3 boxDistSegPt,table_3 segmentSegPt=simGeom.getBoxSegmentDistance(table_3 boxPos,table_3 boxQuat,table_3 boxHalfSize,bool boxIsSolid,table_3 segmentEndPoint,table_3 segmentVector,bool altRoutine=false)
Arguments
boxPos: the position of the cuboid.
boxQuat: the quaternion of the cuboid.
boxHalfSize: the half-size of the cuboid.
boxIsSolid: whether the cuboid is solid. If true, then the segment being fully encompassed by the cuboid will always lead to a distance of zero.
segmentEndPoint: position of vertex A on the segment.
segmentVector: vector stretching from vertex A to vertex B on the segment.
altRoutine: if true, an alternative calculation routine will be used. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities.
boxDistSegPt: the minimum distance point on the cuboid.
segmentSegPt: the minimum distance point on the segment.
See also simGeom.getMeshSegmentDistance, simGeom.getOctreeSegmentDistance, simGeom.getPtcloudSegmentDistance, simGeom.getBoxBoxDistance, simGeom.getBoxTriangleDistance, simGeom.getBoxPointDistance, simGeom.getTriangleSegmentDistance, simGeom.getSegmentSegmentDistance, simGeom.getSegmentPointDistance

simGeom.getBoxTriangleDistance

Description Computes the minimum distance between a cuboid and a triangle.
Synopsis number distance,table_3 boxDistSegPt,table_3 triangleDistSegPt=simGeom.getBoxTriangleDistance(table_3 boxPos,table_3 boxQuat,table_3 boxHalfSize,bool boxIsSolid,table_3 p,table_3 v,table_3 w,bool altRoutine=false)
Arguments
boxPos: the position of the cuboid.
boxQuat: the quaternion of the cuboid.
boxHalfSize: the half-size of the cuboid.
boxIsSolid: whether the cuboid is solid. If true, then the triangle being fully encompassed by the cuboid will always lead to a distance of zero.
p: position of vertex A on the triangle.
v: vector stretching from vertex A to vertex B on the triangle.
w: vector stretching from vertex A to vertex C on the triangle.
altRoutine: if true, an alternative calculation routine will be used. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities.
boxDistSegPt: the minimum distance point on the cuboid.
triangleDistSegPt: the minimum distance point on the triangle.
See also simGeom.getMeshTriangleDistance, simGeom.getOctreeTriangleDistance, simGeom.getPtcloudTriangleDistance, simGeom.getBoxBoxDistance, simGeom.getBoxSegmentDistance, simGeom.getBoxPointDistance, simGeom.getTriangleTriangleDistance, simGeom.getTriangleSegmentDistance, simGeom.getTrianglePointDistance

simGeom.getMeshMeshCollision

Description Checks for collision between two mesh objects.
Synopsis bool collisionResult,table_2 caching,table intersections=simGeom.getMeshMeshCollision(number mesh1Handle,table_3 mesh1Pos,table_4 mesh1Quat,number mesh2Handle,table_3 mesh2Pos,table_4 mesh2Quat,table_2 caching=nil,bool returnIntersections=false)
Arguments
mesh1Handle: the handle of the first mesh object.
mesh1Pos: the position of the first mesh object.
mesh1Quat: the quaternion of the first mesh object.
mesh2Handle: the handle of the second mesh object.
mesh2Pos: the position of the second mesh object.
mesh2Quat: the quaternion of the second mesh object.
caching: a table with two values from previous collision checking between the same two entities, to speed-up calculations.
returnIntersections: whether the interference segments should be computed and returned.
Return value(s)
collisionResult: the collision status
caching: a table with two values that can be used to speed-up next collision checking between the same two entities (memorizes the colliding triangle in the two meshes).
intersections: the interference segments.
See also simGeom.getMeshOctreeCollision, simGeom.getMeshTriangleCollision, simGeom.getMeshSegmentCollision

simGeom.getMeshMeshDistance

Description Computes the minimum distance between two mesh objects.
Synopsis number distance,table_3 minDistSegPt1,table_3 minDistSegPt2,table_2 caching=simGeom.getMeshMeshDistance(number mesh1Handle,table_3 mesh1Pos,table_4 mesh1Quat,number mesh2Handle,table_3 mesh2Pos,table_4 mesh2Quat,number thresholdDist=nil,table_2 caching=nil)
Arguments
mesh1Handle: the handle of the first mesh object.
mesh1Pos: the position of the first mesh.
mesh1Quat: the quaternion of the first mesh.
mesh2Handle: the handle of the second mesh object.
mesh2Pos: the position of the second mesh.
mesh2Quat: the quaternion of the second mesh.
thresholdDist: the distance threshold. Can be omitted.
caching: a table with two values from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
minDistSegPt1: the minimum distance point on the first mesh. nil if the distance is not smaller than the threshold distance.
minDistSegPt2: the minimum distance point on the second mesh. nil if the distance is not smaller than the threshold distance.
caching: a table with two values that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshOctreeDistance, simGeom.getMeshPtcloudDistance, simGeom.getMeshTriangleDistance, simGeom.getMeshSegmentDistance, simGeom.getMeshPointDistance

simGeom.getMeshOctreeCollision

Description Checks for collision between a mesh object and an OC-tree object.
Synopsis bool collisionResult,table_2 caching=simGeom.getMeshOctreeCollision(number meshHandle,table_3 meshPos,table_4 meshQuat,number octreeHandle,table_3 octreePos,table_4 octreeQuat,table_2 caching=nil)
Arguments
meshHandle: the handle of the mesh object.
meshPos: the position of the mesh.
meshQuat: the quaternion of the mesh.
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
caching: a table with two values from previous collision checking between the same two entities, to speed-up calculations.
Return value(s)
collisionResult: the collision status.
caching: a table with two values that can be used to speed-up next collision checking between the same two entities.
See also simGeom.getMeshMeshCollision, simGeom.getMeshTriangleCollision, simGeom.getMeshSegmentCollision, simGeom.getOctreeOctreeCollision, simGeom.getOctreePtcloudCollision, simGeom.getOctreeTriangleCollision, simGeom.getOctreeSegmentCollision, simGeom.getOctreePointCollision

simGeom.getMeshOctreeDistance

Description Computes the minimum distance between a mesh object and an OC-tree object.
Synopsis number distance,table_3 meshMinDistPt,table_3 ocMinDistPt,table_2 caching=simGeom.getMeshOctreeDistance(number meshHandle,table_3 meshPos,table_4 meshQuat,number octreeHandle,table_3 octreePos,table_4 octreeQuat,number thresholdDist=nil,table_2 caching=nil)
Arguments
meshHandle: the handle of the mesh object.
meshPos: the position of the mesh.
meshQuat: the quaternion of the mesh.
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
thresholdDist: the distance threshold. Can be omitted.
caching: a table with two values from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
meshMinDistPt: the minimum distance point on the mesh. nil if the distance is not smaller than the threshold distance.
ocMinDistPt: the minimum distance point on the OC-tree. nil if the distance is not smaller than the threshold distance.
caching: a table with two values that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshMeshDistance, simGeom.getMeshPtcloudDistance, simGeom.getMeshTriangleDistance, simGeom.getMeshSegmentDistance, simGeom.getMeshPointDistance, simGeom.getOctreeOctreeDistance, simGeom.getOctreePtcloudDistance, simGeom.getOctreeTriangleDistance, simGeom.getOctreeSegmentDistance, simGeom.getOctreePointDistance

simGeom.getMeshPointDistance

Description Computes the minimum distance between a mesh object and a point.
Synopsis number distance,table_3 meshMinDistPt,number caching=simGeom.getMeshPointDistance(number meshHandle,table_3 meshPos,table_4 meshQuat,table_3 point,number thresholdDist=nil,number caching=-1)
Arguments
meshHandle: the handle of the mesh object.
meshPos: the position of the mesh.
meshQuat: the quaternion of the mesh.
point: the position of the point.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted or -1.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
meshMinDistPt: the minimum distance point on the mesh. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshMeshDistance, simGeom.getMeshOctreeDistance, simGeom.getMeshPtcloudDistance, simGeom.getMeshTriangleDistance, simGeom.getMeshSegmentDistance, simGeom.getOctreePointDistance, simGeom.getPtcloudPointDistance, simGeom.getBoxPointDistance, simGeom.getTrianglePointDistance, simGeom.getSegmentPointDistance

simGeom.getMeshPtcloudDistance

Description Computes the minimum distance between a mesh object and a point-cloud object.
Synopsis number distance,table_3 meshMinDistPt,table_3 pcMinDistPt,table_2 caching=simGeom.getMeshPtcloudDistance(number meshHandle,table_3 meshPos,table_4 meshQuat,number ptcloudHandle,table_3 pcPos,table_4 pcQuat,number thresholdDist=nil,table_2 caching=nil)
Arguments
meshHandle: the handle of the mesh object.
meshPos: the position of the mesh.
meshQuat: the quaternion of the mesh.
ptcloudHandle: the handle of the point-cloud object.
pcPos: the position of the point-cloud.
pcQuat: the quaternion of the point-cloud.
thresholdDist: the distance threshold. Can be omitted.
caching: a table with two values from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
meshMinDistPt: the minimum distance point on the mesh. nil if the distance is not smaller than the threshold distance.
pcMinDistPt: the minimum distance point on the point-cloud. nil if the distance is not smaller than the threshold distance.
caching: a table with two values that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshMeshDistance, simGeom.getMeshOctreeDistance, simGeom.getMeshTriangleDistance, simGeom.getMeshSegmentDistance, simGeom.getMeshPointDistance, simGeom.getOctreePtcloudDistance, simGeom.getPtcloudPtcloudDistance, simGeom.getPtcloudTriangleDistance, simGeom.getPtcloudSegmentDistance, simGeom.getPtcloudPointDistance

simGeom.getMeshSegmentCollision

Description Checks for collision between a mesh object and a segment.
Synopsis bool collisionResult,number caching,table intersections=simGeom.getMeshSegmentCollision(number meshHandle,table_3 meshPos,table_4 meshQuat,table_3 segmentExtremity,table_3 segmentVector,number caching=-1,bool returnIntersections)
Arguments
meshHandle: the handle of the mesh object.
meshPos: the position of the mesh.
meshQuat: the quaternion of the mesh.
segmentExtremity: position of vertex A on the segment.
segmentVector: vector stretching from vertex A to vertex B on the segment.
caching: a values from previous collision checking between the same two entities, to speed-up collision checking. Can be omitted or set to -1.
returnIntersections: whether the interference segments should be returned. Can be omitted.
Return value(s)
collisionResult: the collision status.
caching: a value that can be used to speed-up next collision checking between the same two entities.
intersections: the interference segments which actually represent one or more segments with zero length.
See also simGeom.getMeshMeshCollision, simGeom.getMeshOctreeCollision, simGeom.getMeshTriangleCollision, simGeom.getOctreeSegmentCollision

simGeom.getMeshSegmentDistance

Description Computes the minimum distance between a mesh object and a segment.
Synopsis number distance,table_3 meshMinDistPt,table_3 segmentDistSegPt,number caching=simGeom.getMeshSegmentDistance(number meshHandle,table_3 meshPos,table_4 meshQuat,table_3 segmentEndPoint,table_3 segmentVector,number thresholdDist=nil,number caching=-1)
Arguments
meshHandle: the handle of the mesh object.
meshPos: the position of the mesh.
meshQuat: the quaternion of the mesh.
segmentEndPoint: position of vertex A on the segment.
segmentVector: vector stretching from vertex A to vertex B on the segment.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted or -1.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
meshMinDistPt: the minimum distance point on the mesh. nil if the distance is not smaller than the threshold distance.
segmentDistSegPt: the minimum distance point on the segment. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshMeshDistance, simGeom.getMeshOctreeDistance, simGeom.getMeshPtcloudDistance, simGeom.getMeshTriangleDistance, simGeom.getMeshPointDistance, simGeom.getOctreeSegmentDistance, simGeom.getPtcloudSegmentDistance, simGeom.getBoxSegmentDistance, simGeom.getTriangleSegmentDistance, simGeom.getSegmentSegmentDistance, simGeom.getSegmentPointDistance

simGeom.getMeshSerializationData

Description Retrieves the serialization data from a mesh object.
Synopsis string serializationData=simGeom.getMeshSerializationData(number meshHandle)
Arguments
meshHandle: the handle of the mesh object.
Return value(s)
serializationData: the serialization data.
See also simGeom.createMeshFromSerializationData

simGeom.getMeshTriangleCollision

Description Checks for collision between a mesh object and a triangle.
Synopsis bool collisionResult,number caching,table intersections=simGeom.getMeshTriangleCollision(number meshHandle,table_3 meshPos,table_4 meshQuat,table_3 p,table_3 v,table_3 w,number caching=-1,bool returnIntersections)
Arguments
meshHandle: the handle of the mesh object.
meshPos: the position of the mesh.
meshQuat: the quaternion of the mesh.
p: position of vertex A on the triangle.
v: vector stretching from vertex A to vertex B on the triangle.
w: vector stretching from vertex A to vertex C on the triangle.
caching: a values from previous collision checking between the same two entities, to speed-up collision checking. Can be omitted or set to -1.
returnIntersections: whether the interference segments should be returned. Can be omitted.
Return value(s)
collisionResult: the collision status.
caching: a value that can be used to speed-up next collision checking between the same two entities.
intersections: the interference segments.
See also simGeom.getMeshMeshCollision, simGeom.getMeshOctreeCollision, simGeom.getMeshSegmentCollision, simGeom.getOctreeTriangleCollision

simGeom.getMeshTriangleDistance

Description Computes the minimum distance between a mesh object and a triangle.
Synopsis number distance,table_3 meshMinDistPt,table_3 triangleMinDistPt,number caching=simGeom.getMeshTriangleDistance(number meshHandle,table_3 meshPos,table_4 meshQuat,table_3 p,table_3 v,table_3 w,number thresholdDist=nil,number caching=-1)
Arguments
meshHandle: the handle of the mesh object.
meshPos: the position of the mesh.
meshQuat: the quaternion of the mesh.
p: position of vertex A on the triangle.
v: vector stretching from vertex A to vertex B on the triangle.
w: vector stretching from vertex A to vertex C on the triangle.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted or -1.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
meshMinDistPt: the minimum distance point on the mesh. nil if the distance is not smaller than the threshold distance.
triangleMinDistPt: the minimum distance point on the triangle. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshMeshDistance, simGeom.getMeshOctreeDistance, simGeom.getMeshPtcloudDistance, simGeom.getMeshSegmentDistance, simGeom.getMeshPointDistance, simGeom.getOctreeTriangleDistance, simGeom.getPtcloudTriangleDistance, simGeom.getBoxTriangleDistance, simGeom.getTriangleTriangleDistance, simGeom.getTriangleSegmentDistance, simGeom.getTrianglePointDistance

simGeom.getOctreeOctreeCollision

Description Checks for collision between two OC-tree objects.
Synopsis bool collisionResult,number caching=simGeom.getOctreeOctreeCollision(number oc1Handle,table_3 octree1Pos,table_4 octree1Quat,number oc2Handle,table_3 octree2Pos,table_4 octree2Quat,table_2 caching=nil)
Arguments
oc1Handle: handle of the first OC-tree object.
octree1Pos: the position of the first OC-tree.
octree1Pos: the quaternion of the first OC-tree.
oc2Handle: handle of the second OC-tree object.
octree2Pos: the position of the second OC-tree.
octree2Pos: the quaternion of the second OC-tree.
caching: a table with two values from previous collision checking between the same two entities, to speed-up collision checking. Can be omitted.
Return value(s)
collisionResult: the collision status.
caching: a table with two values that can be used to speed-up next collision checking between the same two entities.
See also simGeom.getMeshOctreeCollision, simGeom.getOctreePtcloudCollision, simGeom.getOctreeTriangleCollision, simGeom.getOctreeSegmentCollision, simGeom.getOctreePointCollision

simGeom.getOctreeOctreeDistance

Description Computes the minimum distance between two OC-tree objects.
Synopsis number distance,table_3 oc1MinDistPt,table_3 oc2MinDistPt,table_2 caching=simGeom.getOctreeOctreeDistance(number oc1Handle,table_3 octree1Pos,table_4 octree1Quat,number oc2Handle,table_3 octree2Pos,table_4 octree2Quat,number thresholdDist=nil,table_2 caching=nil)
Arguments
oc1Handle: the handle of the first OC-tree object.
octree1Pos: the position of the first OC-tree.
octree1Pos: the quaternion of the first OC-tree.
oc2Handle: the handle of the second OC-tree object.
octree2Pos: the position of the second OC-tree.
octree2Pos: the quaternion of the second OC-tree.
thresholdDist: the distance threshold. Can be omitted.
caching: a table with two values from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
oc1MinDistPt: the minimum distance point on the first OC-tree. nil if the distance is not smaller than the threshold distance.
oc2MinDistPt: the minimum distance point on the second OC-tree. nil if the distance is not smaller than the threshold distance.
caching: a table with two values that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshOctreeDistance, simGeom.getOctreePtcloudDistance, simGeom.getOctreeTriangleDistance, simGeom.getOctreeSegmentDistance, simGeom.getOctreePointDistance

simGeom.getOctreePointCollision

Description Checks for collision between an OC-tree object and a point.
Synopsis bool collisionResult,number caching=simGeom.getOctreePointCollision(number octreeHandle,table_3 octreePos,table_4 octreeQuat,table_3 point,number caching=-1)
Arguments
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
point: a point expressed relative to the world reference frame.
caching: a value from previous collision checking between the same two entities, to speed-up collision checking. Can be omitted or -1.
Return value(s)
collisionResult: the collision status.
caching: a value that can be used to speed-up next collision checking between the same two entities.
See also simGeom.getMeshOctreeCollision, simGeom.getOctreeOctreeCollision, simGeom.getOctreePtcloudCollision, simGeom.getOctreeTriangleCollision, simGeom.getOctreeSegmentCollision

simGeom.getOctreePointDistance

Description Computes the minimum distance between an OC-tree object and a point.
Synopsis number distance,table_3 ocMinDistPt,number caching=simGeom.getOctreePointDistance(number octreeHandle,table_3 octreePos,table_4 octreeQuat,table_3 point,number thresholdDist=nil,number caching=-1)
Arguments
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
point: the position of the point.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted or -1.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
ocMinDistPt: the minimum distance point on the OC-tree. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshOctreeDistance, simGeom.getMeshPointDistance, simGeom.getOctreeOctreeDistance, simGeom.getOctreePtcloudDistance, simGeom.getOctreeTriangleDistance, simGeom.getOctreeSegmentDistance, simGeom.getPtcloudPointDistance, simGeom.getBoxPointDistance, simGeom.getTrianglePointDistance, simGeom.getSegmentPointDistance

simGeom.getOctreePtcloudCollision

Description Checks for collision between am OC-tree object and a point-cloud object.
Synopsis bool collisionResult,number caching=simGeom.getOctreePtcloudCollision(number octreeHandle,table_3 octreePos,table_4 octreeQuat,number ptcloudHandle,table_3 ptcloudPos,table_4 ptcloudQuat,table_2 caching=nil)
Arguments
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
ptcloudHandle: the handle of the point-cloud object.
ptcloudPos: the position of the point-cloud.
ptcloudQuat: the quaternion of the point-cloud.
caching: a table with two values from previous collision checking between the same two entities, to speed-up collision checking..
Return value(s)
collisionResult: the collision status.
caching: a value that can be used to speed-up next collision checking between the same two entities.
See also simGeom.getMeshOctreeCollision, simGeom.getOctreeOctreeCollision, simGeom.getOctreeTriangleCollision, simGeom.getOctreeSegmentCollision, simGeom.getOctreePointCollision

simGeom.getOctreePtcloudDistance

Description Computes the minimum distance between an OC-tree object and a point-cloud object.
Synopsis number distance,table_3 ocMinDistPt,table_3 pcMinDistPt,table_2 caching=simGeom.getOctreePtcloudDistance(number octreeHandle,table_3 octreePos,table_4 octreeQuat,number ptcloudHandle,table_3 pcPos,table_4 pcQuat,number thresholdDist=nil,table_2 caching=nil)
Arguments
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
ptcloudHandle: the handle of the point-cloud object.
pcPos: the position of the point-cloud.
pcQuat: the quaternion of the point-cloud.
thresholdDist: the distance threshold. Can be omitted.
caching: a table with two values from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
ocMinDistPt: the minimum distance point on the OC-tree. nil if the distance is not smaller than the threshold distance.
pcMinDistPt: the minimum distance point on the point-cloud. nil if the distance is not smaller than the threshold distance.
caching: a table with two values that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshPtcloudDistance, simGeom.getOctreeOctreeDistance, simGeom.getOctreeTriangleDistance, simGeom.getOctreeSegmentDistance, simGeom.getOctreePointDistance, simGeom.getPtcloudPtcloudDistance, simGeom.getPtcloudTriangleDistance, simGeom.getPtcloudSegmentDistance, simGeom.getPtcloudPointDistance

simGeom.getOctreeSegmentCollision

Description Checks for collision between an OC-tree object and a segment.
Synopsis bool collisionResult,number caching=simGeom.getOctreeSegmentCollision(number octreeHandle,table_3 octreePos,table_4 octreeQuat,table_3 segmentExtremity,table_3 segmentVector,number caching=-1)
Arguments
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
segmentExtremity: position of vertex A on the segment.
segmentVector: vector stretching from vertex A to vertex B on the segment.
caching: a value from previous collision checking between the same two entities, to speed-up collision checking. Can be omitted or -1.
Return value(s)
collisionResult: the collision status.
caching: a value that can be used to speed-up next collision checking between the same two entities.
See also simGeom.getMeshOctreeCollision, simGeom.getMeshSegmentCollision, simGeom.getOctreeOctreeCollision, simGeom.getOctreePtcloudCollision, simGeom.getOctreeTriangleCollision, simGeom.getOctreePointCollision

simGeom.getOctreeSegmentDistance

Description Computes the minimum distance between an OC-tree object and a segment.
Synopsis number distance,table_3 ocMinDistPt,table_3 segmentDistSegPt,number caching=simGeom.getOctreeSegmentDistance(number octreeHandle,table_3 octreePos,table_4 octreeQuat,table_3 segmentEndPoint,table_3 segmentVector,number thresholdDist=nil,number caching=-1)
Arguments
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
segmentEndPoint: position of vertex A on the segment.
segmentVector: vector stretching from vertex A to vertex B on the segment.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted or -1.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
ocMinDistPt: the minimum distance point on the OC-tree. nil if the distance is not smaller than the threshold distance.
segmentDistSegPt: the minimum distance point on the segment. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshOctreeDistance, simGeom.getMeshSegmentDistance, simGeom.getOctreeOctreeDistance, simGeom.getOctreePtcloudDistance, simGeom.getOctreeTriangleDistance, simGeom.getOctreePointDistance, simGeom.getPtcloudSegmentDistance, simGeom.getBoxSegmentDistance, simGeom.getTriangleSegmentDistance, simGeom.getSegmentSegmentDistance, simGeom.getSegmentPointDistance

simGeom.getOctreeSerializationData

Description Retrieves the serialization data from an OC-tree object.
Synopsis string serializationData=simGeom.getOctreeSerializationData(number octreeHandle)
Arguments
octreeHandle: the handle of the OC-tree object.
Return value(s)
serializationData: the serialization data.
See also simGeom.createOctreeFromSerializationData

simGeom.getOctreeTriangleCollision

Description Checks for collision between an OC-tree object and a triangle.
Synopsis bool collisionResult,number caching=simGeom.getOctreeTriangleCollision(number octreeHandle,table_3 octreePos,table_4 octreeQuat,table_3 p,table_3 v,table_3 w,number caching=-1)
Arguments
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
p: position of vertex A on the triangle.
v: vector stretching from vertex A to vertex B on the triangle.
w: vector stretching from vertex A to vertex C on the triangle.
caching: a value from previous collision checking between the same two entities, to speed-up collision checking. Can be omitted or -1.
Return value(s)
collisionResult: the collision status.
caching: a value that can be used to speed-up next collision checking between the same two entities.
See also simGeom.getMeshOctreeCollision, simGeom.getMeshTriangleCollision, simGeom.getOctreeOctreeCollision, simGeom.getOctreePtcloudCollision, simGeom.getOctreeSegmentCollision, simGeom.getOctreePointCollision

simGeom.getOctreeTriangleDistance

Description Computes the minimum distance between an OC-tree object and a triangle.
Synopsis number distance,table_3 ocMinDistPt,table_3 triangleMinDistPt,number caching=simGeom.getOctreeTriangleDistance(number octreeHandle,table_3 octreePos,table_4 octreeQuat,table_3 p,table_3 v,table_3 w,number thresholdDist=nil,number caching=-1)
Arguments
octreeHandle: the handle of the OC-tree object.
octreePos: the position of the OC-tree.
octreeQuat: the quaternion of the OC-tree.
p: position of vertex A on the triangle.
v: vector stretching from vertex A to vertex B on the triangle.
w: vector stretching from vertex A to vertex C on the triangle.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted or -1.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
ocMinDistPt: the minimum distance point on the OC-tree. nil if the distance is not smaller than the threshold distance.
triangleMinDistPt: the minimum distance point on the triangle. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshOctreeDistance, simGeom.getMeshTriangleDistance, simGeom.getOctreeOctreeDistance, simGeom.getOctreePtcloudDistance, simGeom.getOctreeSegmentDistance, simGeom.getOctreePointDistance, simGeom.getPtcloudTriangleDistance, simGeom.getBoxTriangleDistance, simGeom.getTriangleTriangleDistance, simGeom.getTriangleSegmentDistance, simGeom.getTrianglePointDistance

simGeom.getOctreeVoxels

Description Retrieves voxel data from an OC-tree.
Synopsis table posData,table colorData,table userData=simGeom.getOctreeVoxels(number octreeHandle)
Arguments
octreeHandle: the handle of the OC-tree object.
Return value(s)
posData: position data: for each voxel, there are 3 position values (XYZ).
colorData: color data: for each voxel, there are 3 color values (RGB, 0-1).
userData: user data: for each voxel, there is one user data value.
See also

simGeom.getPtcloudPointDistance

Description Computes the minimum distance between a point-cloud object and a point.
Synopsis number distance,table_3 pcMinDistPt,number caching=simGeom.getPtcloudPointDistance(number ptcloudHandle,table_3 pcPos,table_4 pcQuat,table_3 point,number thresholdDist=nil,number caching=-1)
Arguments
ptcloudHandle: the handle of the point-cloud object.
pcPos: the position of the point-cloud.
pcQuat: the quaternion of the point-cloud.
point: the position of the point.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
pcMinDistPt: the minimum distance point on the point-cloud. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshPtcloudDistance, simGeom.getMeshPointDistance, simGeom.getOctreePtcloudDistance, simGeom.getOctreePointDistance, simGeom.getPtcloudPtcloudDistance, simGeom.getPtcloudTriangleDistance, simGeom.getPtcloudSegmentDistance, simGeom.getBoxPointDistance, simGeom.getTrianglePointDistance, simGeom.getSegmentPointDistance

simGeom.getPtcloudPoints

Description Retrieves point data from a point-cloud.
Synopsis table posData,table colorData=simGeom.getPtcloudPoints(number ptcloudHandle,number prop=1)
Arguments
ptcloudHandle: the handle of the point-cloud object.
prop: the proportion of data to retrieve, on a voxel-basis. 1 retrieves all data, 0.25 retrieves 25% of the data.
Return value(s)
posData: the position data: for each point, there are 3 position values (XYZ).
colorData: the color data: for each point, there are 3 color values (RGB, 0-1).
See also

simGeom.getPtcloudPtcloudDistance

Description Computes the minimum distance between two point-cloud objects.
Synopsis number distance,table_3 pc1MinDistPt,table_3 pc2MinDistPt,table_2 caching=simGeom.getPtcloudPtcloudDistance(number pc1Handle,table_3 pc1pos,table_4 pc1Quat,number pc2Handle,table_3 pc2Pos,table_4 pc2Quat,number distanceThreshold=nil,table_2 caching)
Arguments
pc1Handle: the handle of the first point-cloud object.
pc1Pos: the position of the first point-cloud.
pc1Quat: the quaternion of the first point-cloud.
pc2Handle: the handle of the second point-cloud object.
pc2Pos: the position of the second point-cloud.
pc2Quat: the quaternion of the second point-cloud.
distanceThreshold: the distance threshold. Can be omitted.
caching: a table with two values from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
pc1MinDistPt: the minimum distance point on the first point-cloud. nil if the distance is not smaller than the threshold distance.
pc2MinDistPt: the minimum distance point on the second point-cloud. nil if the distance is not smaller than the threshold distance.
caching: a table with two values that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshPtcloudDistance, simGeom.getOctreePtcloudDistance, simGeom.getPtcloudTriangleDistance, simGeom.getPtcloudSegmentDistance, simGeom.getPtcloudPointDistance

simGeom.getPtcloudSegmentDistance

Description Computes the minimum distance between a point-cloud and a segment.
Synopsis number distance,table_3 pcMinDistPt,table_3 segmentDistSegPt,number caching=simGeom.getPtcloudSegmentDistance(number ptcloudHandle,table_3 pcPos,table_4 pcQuat,table_3 segmentEndPoint,table_3 segmentVector,number thresholdDist=nil,number caching=-1)
Arguments
ptcloudHandle: the handle of the point-cloud object.
pcPos: the position of the point-cloud.
pcQuat: the quaternion of the point-cloud.
segmentEndPoint: position of vertex A on the segment.
segmentVector: vector stretching from vertex A to vertex B on the segment.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
pcMinDistPt: the minimum distance point on the point-cloud. nil if the distance is not smaller than the threshold distance.
segmentDistSegPt: the minimum distance point on the segment. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshPtcloudDistance, simGeom.getMeshSegmentDistance, simGeom.getOctreePtcloudDistance, simGeom.getOctreeSegmentDistance, simGeom.getPtcloudPtcloudDistance, simGeom.getPtcloudTriangleDistance, simGeom.getPtcloudPointDistance, simGeom.getBoxSegmentDistance, simGeom.getTriangleSegmentDistance, simGeom.getSegmentSegmentDistance, simGeom.getSegmentPointDistance

simGeom.getPtcloudSerializationData

Description Retrieves the serialization data from a point-cloud object.
Synopsis string serializationData=simGeom.getPtcloudSerializationData(number ptcloudHandle)
Arguments
ptcloudHandle: the handle of the point-cloud object.
Return value(s)
serializationData: the serialization data.
See also simGeom.createPtcloudFromSerializationData

simGeom.getPtcloudTriangleDistance

Description Computes the minimum distance between a point-cloud object and a triangle.
Synopsis number distance,table_3 pcMinDistPt,table_3 triangleMinDistPt,number caching=simGeom.getPtcloudTriangleDistance(number ptcloudHandle,table_3 pcPos,table_4 pcQuat,table_3 p,table_3 v,table_3 w,number thresholdDist=nil,number caching=nil)
Arguments
ptcloudHandle: the handle of the point-cloud object.
pcPos: the position of the point-cloud.
pcQuat: the quaternion of the point-cloud.
p: position of vertex A on the triangle.
v: vector stretching from vertex A to vertex B on the triangle.
w: vector stretching from vertex A to vertex C on the triangle.
thresholdDist: the distance threshold. Can be omitted.
caching: a value from previous distance calculation between the same two entities, to speed-up calculations. Can be omitted.
Return value(s)
distance: the minimum distance between the two entities, or if it is not smaller than the threshold distance, the threshold distance.
pcMinDistPt: the minimum distance point on the point-cloud. nil if the distance is not smaller than the threshold distance.
triangleMinDistPt: the minimum distance point on the triangle. nil if the distance is not smaller than the threshold distance.
caching: a value that can be used to speed-up next distance calculation between the same two entities. nil if the distance is not smaller than the threshold distance.
See also simGeom.getMeshPtcloudDistance, simGeom.getOctreePtcloudDistance, simGeom.getPtcloudPtcloudDistance, simGeom.getPtcloudSegmentDistance, simGeom.getPtcloudPointDistance, simGeom.getBoxTriangleDistance, simGeom.getTriangleTriangleDistance, simGeom.getTriangleSegmentDistance, simGeom.getTrianglePointDistance

simGeom.getSegmentPointDistance

Description Computes the minimum distance between a segment and a point.
Synopsis number distance,table_3 segmentDistSegPt=simGeom.getSegmentPointDistance(table_3 segmentEndPoint,table_3 segmentVector,table_3 point)
Arguments
segmentEndPoint: position of vertex A on the segment.
segmentVector: vector stretching from vertex A to vertex B on the segment.
point: position of the point
Return value(s)
distance: the minimum distance between the two entities.
segmentDistSegPt: the minimum distance point on the segment.
See also simGeom.getMeshSegmentDistance, simGeom.getMeshPointDistance, simGeom.getOctreeSegmentDistance, simGeom.getOctreePointDistance, simGeom.getPtcloudSegmentDistance, simGeom.getPtcloudPointDistance, simGeom.getBoxSegmentDistance, simGeom.getBoxPointDistance, simGeom.getTriangleSegmentDistance, simGeom.getTrianglePointDistance, simGeom.getSegmentSegmentDistance

simGeom.getSegmentSegmentDistance

Description Computes the minimum distance between two segments.
Synopsis number distance,table_3 segment1DistSegPt,table_3 segment2DistSegPt=simGeom.getSegmentSegmentDistance(table_3 segment1EndPoint,table_3 segment1Vector,table_3 segment2EndPoint,table_3 segment2Vector)
Arguments
segment1EndPoint: position of point A on the first segment
segment1Vector: vector stretching from point A to point B on the first segment.
segment2EndPoint: position of point A on the second segment
segment2Vector: vector stretching from point A to point B on the second segment.
Return value(s)
distance: the minimum distance between the two entities.
segment1DistSegPt: the minimum distance point on the first segment.
segment2DistSegPt: the minimum distance point on the second segment.
See also simGeom.getMeshSegmentDistance, simGeom.getOctreeSegmentDistance, simGeom.getPtcloudSegmentDistance, simGeom.getBoxSegmentDistance, simGeom.getTriangleSegmentDistance, simGeom.getSegmentPointDistance

simGeom.getTransformedPoints

Description Transforms points via a transformation matrix, or via a position and a quaternion or Euler angles.
Synopsis
1) table transformedPoints=simGeom.getTransformedPoints(table points,table_12 transformationMatrix)
2) table transformedPoints=simGeom.getTransformedPoints(table points,table_3 pos,table_4 quaternion)
2) table transformedPoints=simGeom.getTransformedPoints(table points,table_3 pos,table_3 eulerAngles)
Arguments
points: the points to transform.
transformationMatrix: a transformation matrix: 12 values (the last row of the 4x4 matrix (0,0,0,1) is not needed). The x-axis of the orientation component is (matrix[1],matrix[5],matrix[9]), the y-axis of the orientation component is (matrix[2],matrix[6],matrix[10]), the z-axis of the orientation component is (matrix[3],matrix[7],matrix[11]), and the translation component is (matrix[4],matrix[8],matrix[12]).
pos: a position.
quaternion: a quaternion.
eulerAngles: Euler angles.
Return value(s)
transformedPoints: the transformed points.
See also

simGeom.getTrianglePointDistance

Description Computes the minimum distance between a triangle and a point.
Synopsis number distance,table_3 triangleDistSegPt=simGeom.getTrianglePointDistance(table_3 p,table_3 v,table_3 w,table_3 point)
Arguments
p: position of vertex A on the triangle.
v: vector stretching from vertex A to vertex B on the triangle.
w: vector stretching from vertex A to vertex C on the triangle.
point: position of the point
Return value(s)
distance: the minimum distance between the two entities.
triangleDistSegPt: the minimum distance point on the triangle.
See also simGeom.getMeshTriangleDistance, simGeom.getMeshPointDistance, simGeom.getOctreeTriangleDistance, simGeom.getOctreePointDistance, simGeom.getPtcloudTriangleDistance, simGeom.getPtcloudPointDistance, simGeom.getBoxTriangleDistance, simGeom.getBoxPointDistance, simGeom.getTriangleTriangleDistance, simGeom.getTriangleSegmentDistance, simGeom.getSegmentPointDistance

simGeom.getTriangleSegmentDistance

Description Computes the minimum distance between a triangle and a segment.
Synopsis number distance,table_3 triangleDistSegPt,table_3 segmentDistSegPt=simGeom.getTriangleSegmentDistance(table_3 p,table_3 v,table_3 w,table_3 segmentEndPoint,table_3 segmentVector)
Arguments
p: position of vertex A on the triangle.
v: vector stretching from vertex A to vertex B on the triangle.
w: vector stretching from vertex A to vertex C on the triangle.
segmentEndPoint: position of vertex A on the segment.
segmentVector: vector stretching from vertex A to vertex B on the segment.
Return value(s)
distance: the minimum distance between the two entities.
triangleDistSegPt: the minimum distance point on the triangle.
segmentDistSegPt: the minimum distance point on the segment.
See also simGeom.getMeshTriangleDistance, simGeom.getMeshSegmentDistance, simGeom.getOctreeTriangleDistance, simGeom.getOctreeSegmentDistance, simGeom.getPtcloudTriangleDistance, simGeom.getPtcloudSegmentDistance, simGeom.getBoxTriangleDistance, simGeom.getBoxSegmentDistance, simGeom.getTriangleTriangleDistance, simGeom.getTrianglePointDistance, simGeom.getSegmentSegmentDistance, simGeom.getSegmentPointDistance

simGeom.getTriangleTriangleDistance

Description Computes the minimum distance between two triangles.
Synopsis number distance,table_3 distSegPt1,table_3 distSegPt2=simGeom.getTriangleTriangleDistance(table_3 p1,table_3 v1,table_3 w1,table_3 p2,table_3 v2,table_3 w2)
Arguments
p1: position of point A on triangle 1.
v1: vector stretching from point A to point B on triangle 1.
w1: vector stretching from point A to point C on triangle 1.
p2: position of point A on triangle 2.
v2: vector stretching from point A to point B on triangle 2.
w2: vector stretching from point A to point C on triangle 2.
Return value(s)
distance: the minimum distance between the two entities.
triangle1DistSegPt: the minimum distance point on the first triangle.
triangle2DistSegPt: the minimum distance point on the second triangle.
See also simGeom.getMeshTriangleDistance, simGeom.getOctreeTriangleDistance, simGeom.getPtcloudTriangleDistance, simGeom.getBoxTriangleDistance, simGeom.getTriangleSegmentDistance, simGeom.getTrianglePointDistance

simGeom.scaleMesh

Description Scales a mesh object.
Synopsis simGeom.scaleMesh(number meshHandle,number scalingFactor)
Arguments
meshHandle: the handle of the mesh object.
scalingFactor: the scaling factor.
Return value(s)
See also

simGeom.scaleOctree

Description Scales an OC-tree object.
Synopsis simGeom.scaleOctree(number octreeHandle,number scalingFactor)
Arguments
octreeHandle: the handle of the OC-tree object.
scalingFactor: the scaling factor.
Return value(s)
See also

simGeom.scalePtcloud

Description Scales a point-cloud object.
Synopsis simGeom.scalePtcloud(number ptcloudHandle,number scalingFactor)
Arguments
ptcloudHandle: the handle of the point-cloud object.
scalingFactor: the scaling factor.
Return value(s)
See also