public class PolygonalTubeFactory extends TubeFactory
TubeFactoryimplements a simple tubing strategy based on fitting together cylindrical pieces around each segment of the underlying curve. The cylindrical segment which tubes the segment joining vertex vi to vertex vi+1 is defined as follows. Let L be the line joining the two points, and let Pi be the angle bisector of the segments which meet at vi. Then C is the segment of the infinite cylinder around L cut out by the two planes Pi and Pi+1.
The tube factory attempts to detect that the curve is closed by inspecting the first and
last points for equality (within a standard tolerance). You can also force the
curve to be closed with the
Then the effect is as if a final point had been appended that is equal to the first one.
The resulting geometry can be gotten after the call to
update(), via the
IndexedLineSet ils = IndexedLineSetUtility.discreteTorusKnot(1,.25, 2, 9, 250)
PolygonalTubeFactory ptf = new PolygonalTubeFactory(ils, 0);
IndexedFaceSet torus1Tubes = ptf.getTube();
SceneGraphComponent sgc = new SceneGraphComponent();
|Constructor and Description|
|Modifier and Type||Method and Description|
This returns the current state of the tube geometry, as of the last call to
Update the state of the output tube to reflect the current state of all settable variables.
getFrameField, getFramesSceneGraphRepresentation, getInitialBinormal, getSceneGraphRepresentation, getSceneGraphRepresentation, getTangents, getUserBinormals, getXYZAxes, isArcLengthTextureCoordinates, isExtendAtEnds, isGenerateEdges, isGenerateTextureCoordinates, isMatchClosedTwist, isRemoveDuplicates, makeFrameField, setArcLengthTextureCoordinates, setClosed, setCrossSection, setEdgeColors, setExtendAtEnds, setFrameField, setFrameFieldType, setGenerateEdges, setGenerateTextureCoordinates, setInitialBinormal, setMatchClosedTwist, setMetric, setRadii, setRadius, setRemoveDuplicates, setTangents, setTwists, setUserBinormals, setVertexColors, setVertexColorsEnabled
public PolygonalTubeFactory(double curve)
public PolygonalTubeFactory(IndexedLineSet ils, int whichCurve)
public void update()
public IndexedFaceSet getTube()