Class CrossSection3D

java.lang.Object
cz.fidentis.analyst.data.shapes.CrossSection3D

public class CrossSection3D extends Object
A 3D poly-line consisting of multiple segments produced, e.g., by cutting planes.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    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.
    List<List<javax.vecmath.Point2d>>
    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.
    List<List<javax.vecmath.Point3d>>
    Returns all segments.
    int
    getSegmentSize(int segment)
    Returns number of points in given segment.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 segment
      point - A 3D point to be inserted
      Throws:
      IllegalArgumentException - if the segment does not exist or the point is null
    • 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 segment
      point - A 3D point to be inserted
      Throws:
      IllegalArgumentException - if the segment does not exist or the point is null
    • 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

      public List<javax.vecmath.Point3d> getSegment(int segment)
      Returns given segment.
      Parameters:
      segment - Index of the segment
      Returns:
      Points of the segment
      Throws:
      IllegalArgumentException - if the segment does not exist
    • getSegments

      public List<List<javax.vecmath.Point3d>> getSegments()
      Returns all segments.
      Returns:
      Curve segments
    • getFlattened

      public List<List<javax.vecmath.Point2d>> getFlattened(javax.vecmath.Vector3d dir)
      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 point
      planeNormal - approximately orthogonal normal vector
      Returns:
      2D point