Package org.robwork.sdurw_geometry
Class TriMeshSurfaceSampler
- java.lang.Object
-
- org.robwork.sdurw_geometry.TriMeshSurfaceSampler
-
public class TriMeshSurfaceSampler extends java.lang.Objectrandom sampling of points and orientations close to the surface of a geometry.
A point p on the surface is randomly choosen.
A rotation rot is randomly generated.
A random distance d in the interval [minD, maxD] is generated
The position pos is calculated as pos = p - rot*(0,0,d)^T
The random pose X is thus X = (pos, rot)
Optionally a random rotation of X can be generated such that z-axis of rot is
not allways pointing toward the surface.
-
-
Constructor Summary
Constructors Constructor Description TriMeshSurfaceSampler()constructorTriMeshSurfaceSampler(long cPtr, boolean cMemoryOwn)TriMeshSurfaceSampler(GeometryPtr geom)constructorTriMeshSurfaceSampler(VectorGeometryPtr geoms)constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(GeometryPtr geom)add surface representing geometry to this samplervoidadd(TriMeshPtr mesh)add surface mesh.voiddelete()static longgetCPtr(TriMeshSurfaceSampler obj)TriMeshPtrgetMesh()return the mesh that is being sampledTransform3Dsample()sample a pose on the surface of the object.Vector3DsamplePoint()sample point on surface of object
Conditional comment:
End of conditional comment.voidsetBoundsD(double minD, double maxD)set the bounds to which the random position around the sampled surface
point will be generated.voidsetRandomPositionEnabled(boolean enabled)enables generation of a random position within the sampled surface position.
The local point will be generated within a min and max distance from the sampled
surface point.voidsetRandomRotationEnabled(boolean enabled)enable the generation of a random rotation instead of a rotation with
the z-axis pointing in the surface normal direction.voidsetZAxisDirection(Vector3D dir)sets the direction that the z-axis must point into.voidsetZAxisDirectionEnabled(boolean enabled)enable z-axis direction filtering.
-
-
-
Constructor Detail
-
TriMeshSurfaceSampler
public TriMeshSurfaceSampler(long cPtr, boolean cMemoryOwn)
-
TriMeshSurfaceSampler
public TriMeshSurfaceSampler()
constructor
-
TriMeshSurfaceSampler
public TriMeshSurfaceSampler(GeometryPtr geom)
constructor- Parameters:
geom- [in] geometry representing the surface that should be sampled.
-
TriMeshSurfaceSampler
public TriMeshSurfaceSampler(VectorGeometryPtr geoms)
constructor- Parameters:
geoms- [in] list of geometries representing the surface that should be sampled.
-
-
Method Detail
-
getCPtr
public static long getCPtr(TriMeshSurfaceSampler obj)
-
delete
public void delete()
-
add
public void add(GeometryPtr geom)
add surface representing geometry to this sampler- Parameters:
geom- [in] geometry representing surface to be sampled
-
add
public void add(TriMeshPtr mesh)
add surface mesh.- Parameters:
mesh- [in] mesh to add to sampler.
-
sample
public Transform3D sample()
sample a pose on the surface of the object.- Returns:
- transform3d of the sampled pose
-
samplePoint
public Vector3D samplePoint()
sample point on surface of object
Conditional comment:
End of conditional comment.
-
setBoundsD
public void setBoundsD(double minD, double maxD)set the bounds to which the random position around the sampled surface
point will be generated. See setRandomPositionEnabled- Parameters:
minD- [in] minimum distancemaxD- [in] maximum distance.
-
setRandomRotationEnabled
public void setRandomRotationEnabled(boolean enabled)
enable the generation of a random rotation instead of a rotation with
the z-axis pointing in the surface normal direction.- Parameters:
enabled- [in]
-
setRandomPositionEnabled
public void setRandomPositionEnabled(boolean enabled)
enables generation of a random position within the sampled surface position.
The local point will be generated within a min and max distance from the sampled
surface point. See setBoundsD- Parameters:
enabled- [in] true to enable local random generation around sampled surface point.
False otherwise.
-
setZAxisDirectionEnabled
public void setZAxisDirectionEnabled(boolean enabled)
enable z-axis direction filtering. See setZAxisDirection for information
on setting the direction.
- Parameters:
enabled-
-
setZAxisDirection
public void setZAxisDirection(Vector3D dir)
sets the direction that the z-axis must point into. this is equal
to testing if the z-axis of the generated pose lies on the right side of
the plane defined by the plane normal dir and (0,0,0).
Setting this also sets setZAxisDirectionEnabled( true )
- Parameters:
dir- [in]
-
getMesh
public TriMeshPtr getMesh()
return the mesh that is being sampled- Returns:
- mesh
-
-