Package org.robwork.sdurw_geometry
Class QuadraticBREP
- java.lang.Object
-
- org.robwork.sdurw_geometry.GeometryData
-
- org.robwork.sdurw_geometry.QuadraticBREP
-
public class QuadraticBREP extends GeometryData
A boundary representation where the geometry of a face is a QuadraticSurface,
and an edge curve is a QuadraticCurve.
This implementation adds the geometry related to Quadrics, based on BREP which handles the
topology.
To build a geometry composed of Quadratic surfaces and curves, follow the following
procedure:
1. Add all the needed vertices by using the addVertex function.
Each vertex is given an index starting, increasing from zero.
2. Add the edges with the addEdge function. An edge is added between two vertices using their
vertex indexes. The edge requires a QuadraticCurve and two vertex indicies. Notice that the
curve must have limits, such that it start in the first vertex and ends in the second vertex
(the curve has a direction). Each edge is given an index, increasing from zero.
3. Use the makeLoop function to form loops, based on the edges just added. The makeLoop takes
an arbitrary number of edge indexes. Notice that makeLoop expects the edge indexing to start
at 1, and supports negative indices to indicate direction of the edge. To form a loop, a list
of these indexes is given, to form a counter clockwise loop of edges. Each loop is given a
loop index, increasing from zero.
4. Attach a QuadraticSurface to a loop, by using the setSurface function.
Each surface is given an increasing surface index, starting from zero. Notice that this index
is not necessarily the same as the loop index.
Together this forms a connected set of surfaces, curves and vertices, that forms a closed
geometry. Functions are provided that makes it easy to search for various neighbouring
primitives in the boundary representation.
It is also possible to retrieve a non-connected shell representation, either by making a
PlainQuadraticShell with all information fully copied, or by using a the more lightweight
shellProxy which retrieves its information from the underlying QuadraticBREP.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QuadraticBREP.CommonQuadraticCurveSet
Convenience type for a set of curves in a QuadraticBREP.-
Nested classes/interfaces inherited from class org.robwork.sdurw_geometry.GeometryData
GeometryData.GeometryType
-
-
Constructor Summary
Constructors Constructor Description QuadraticBREP(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEdge(QuadraticCurve curve, long v1, long v2)
Add a QuadraticCurve to the BREP.
Notice that the curve has direction.QuadraticBREPPtr
clone()
void
delete()
SWIGTYPE_p_rw__core__PtrT_rw__geometry__QuadraticBREP__CommonQuadraticCurveSet_const_t
getCommonCurves(SWIGTYPE_p_std__setT_unsigned_long_t faces)
static long
getCPtr(QuadraticBREP obj)
QuadraticCurve
getCurve(long curveIndex)
SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__QuadraticCurve_t_t
getCurves(long loopIdx)
QuadraticSurface
getSurface(long surfaceIndex)
GeometryData.GeometryType
getType()
the type of this primitivevoid
scale(double factor)
void
setFace(QuadraticSurface surface, long loop)
Attach a QuadraticSurface to a face of the BREP.PlainQuadraticShellPtr
shell()
Get a QuadraticShell representation by copying geometric information to a concrete
PlainQuadraticShell object.QuadraticShellCPtr
shellProxy()
-
Methods inherited from class org.robwork.sdurw_geometry.GeometryData
getCPtr, getTriMesh, getTriMesh, isConvex, toString
-
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(QuadraticBREP obj)
-
delete
public void delete()
- Overrides:
delete
in classGeometryData
-
getType
public GeometryData.GeometryType getType()
Description copied from class:GeometryData
the type of this primitive- Overrides:
getType
in classGeometryData
-
getSurface
public QuadraticSurface getSurface(long surfaceIndex)
-
getCurve
public QuadraticCurve getCurve(long curveIndex)
-
scale
public void scale(double factor)
-
clone
public QuadraticBREPPtr clone()
-
shellProxy
public QuadraticShellCPtr shellProxy()
-
shell
public PlainQuadraticShellPtr shell()
Get a QuadraticShell representation by copying geometric information to a concrete
PlainQuadraticShell object.- Returns:
- smart pointer to a PlainQuadraticShell object.
-
getCurves
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__QuadraticCurve_t_t getCurves(long loopIdx)
-
getCommonCurves
public SWIGTYPE_p_rw__core__PtrT_rw__geometry__QuadraticBREP__CommonQuadraticCurveSet_const_t getCommonCurves(SWIGTYPE_p_std__setT_unsigned_long_t faces)
-
addEdge
public void addEdge(QuadraticCurve curve, long v1, long v2)
Add a QuadraticCurve to the BREP.
Notice that the curve has direction. It is expected to have limits such that it starts in
vertex v1 and end in v2.
- Parameters:
curve
- [in] curve to add.v1
- [in] the start vertex.v2
- [in] the end vertex.
-
setFace
public void setFace(QuadraticSurface surface, long loop)
Attach a QuadraticSurface to a face of the BREP.- Parameters:
surface
- [in] surface to add.loop
- [in] the loop index for the loop to attach surface to.
-
-