Package cz.fidentis.analyst.data.shapes
Class CrossSection3D
java.lang.Object
cz.fidentis.analyst.data.shapes.CrossSection3D
A 3D poly-line consisting of multiple segments produced, e.g., by cutting planes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Adds a new segment to the curve.void
addPointToSegmentEnd
(int segment, javax.vecmath.Point3d point) Add a new point to the end of the curve segment.void
addPointToSegmentStart
(int segment, javax.vecmath.Point3d point) Add a new point to the beginning of the curve segment.static javax.vecmath.Point2d
flattenPoint
(javax.vecmath.Point3d point3d, javax.vecmath.Vector3d planeNormal) Flattens a 3D point into 2D based on given plane normal by removing a coordinate.getFlattened
(javax.vecmath.Vector3d dir) Flattening, i.e., the projection into the X, Y, or Z 2D plane.List
<javax.vecmath.Point3d> getSegment
(int segment) Returns given segment.Returns all segments.int
getSegmentSize
(int segment) Returns number of points in given segment.
-
Constructor Details
-
CrossSection3D
public CrossSection3D()
-
-
Method Details
-
addPointToSegmentStart
public void addPointToSegmentStart(int segment, javax.vecmath.Point3d point) Add a new point to the beginning of the curve segment.- Parameters:
segment
- Index of the segmentpoint
- A 3D point to be inserted- Throws:
IllegalArgumentException
- if the segment does not exist or the point isnull
-
addPointToSegmentEnd
public void addPointToSegmentEnd(int segment, javax.vecmath.Point3d point) Add a new point to the end of the curve segment.- Parameters:
segment
- Index of the segmentpoint
- A 3D point to be inserted- Throws:
IllegalArgumentException
- if the segment does not exist or the point isnull
-
addNewSegment
public int addNewSegment()Adds a new segment to the curve.- Returns:
- Index of the new segment
-
getSegmentSize
public int getSegmentSize(int segment) Returns number of points in given segment.- Parameters:
segment
- Index of the segment- Returns:
- number of points in given segment.
- Throws:
IllegalArgumentException
- if the segment does not exist
-
getSegment
Returns given segment.- Parameters:
segment
- Index of the segment- Returns:
- Points of the segment
- Throws:
IllegalArgumentException
- if the segment does not exist
-
getSegments
Returns all segments.- Returns:
- Curve segments
-
getFlattened
Flattening, i.e., the projection into the X, Y, or Z 2D plane.- Parameters:
dir
- Either (1,0,0), (0,1,0) or (0,0,1) projection direction.- Returns:
- the 3D segmented poly-line projected on the plane with given direction.
-
flattenPoint
public static javax.vecmath.Point2d flattenPoint(javax.vecmath.Point3d point3d, javax.vecmath.Vector3d planeNormal) Flattens a 3D point into 2D based on given plane normal by removing a coordinate.- Parameters:
point3d
- given pointplaneNormal
- approximately orthogonal normal vector- Returns:
- 2D point
-