Top Description Inners Fields Constructors Methods
org.apache.commons.math3.geometry.euclidean.threed

public Class OutlineExtractor

extends Object
Class Inheritance
Imports
java.util.ArrayList, org.apache.commons.math3.geometry.Point, org.apache.commons.math3.geometry.euclidean.twod.Euclidean2D, .PolygonsSet, .Vector2D, org.apache.commons.math3.geometry.partitioning.AbstractSubHyperplane, .BSPTree, .BSPTreeVisitor, .BoundaryAttribute, .RegionFactory, .SubHyperplane, org.apache.commons.math3.util.FastMath

Extractor for polyhedrons sets outlines.

This class extracts the 2D outlines from {polyhedrons sets in a specified projection plane.

Since
3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
OutlineExtractor.BoundaryProjector

Visitor projecting the boundary facets on a plane.

Field Summary

Modifier and TypeField and Description
private Vector3D
u

Abscissa axis of the projection plane.

private Vector3D
v

Ordinate axis of the projection plane.

private Vector3D
w

Normal of the projection plane (viewing direction).

Constructor Summary

AccessConstructor and Description
public
OutlineExtractor(final Vector3D
abscissa axis of the projection point
u
,
final Vector3D
ordinate axis of the projection point
v
)

Build an extractor for a specific projection plane.

Method Summary

Modifier and TypeMethod and Description
public Vector2D[][]

Returns:

an outline, as an array of loops.
getOutline
(final PolyhedronsSet
polyhedrons set whose outline must be extracted
polyhedronsSet
)

Extract the outline of a polyhedrons set.

private boolean

Returns:

true if the point is exactly between its neighbors
pointIsBetween
(final Vector2D[]
points array
loop
,
final int
number of points to consider in the array
n
,
final int
index of the point to check (must be between 0 and n-1)
i
)

Check if a point is geometrically between its neighbor in an array.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

uback to summary
private Vector3D u

Abscissa axis of the projection plane.

vback to summary
private Vector3D v

Ordinate axis of the projection plane.

wback to summary
private Vector3D w

Normal of the projection plane (viewing direction).

Constructor Detail

OutlineExtractorback to summary
public OutlineExtractor(final Vector3D u, final Vector3D v)

Build an extractor for a specific projection plane.

Parameters
u:Vector3D

abscissa axis of the projection point

v:Vector3D

ordinate axis of the projection point

Method Detail

getOutlineback to summary
public Vector2D[][] getOutline(final PolyhedronsSet polyhedronsSet)

Extract the outline of a polyhedrons set.

Parameters
polyhedronsSet:PolyhedronsSet

polyhedrons set whose outline must be extracted

Returns:Vector2D[][]

an outline, as an array of loops.

pointIsBetweenback to summary
private boolean pointIsBetween(final Vector2D[] loop, final int n, final int i)

Check if a point is geometrically between its neighbor in an array.

The neighbors are computed considering the array is a loop (i.e. point at index (n-1) is before point at index 0)

Parameters
loop:Vector2D[]

points array

n:int

number of points to consider in the array

i:int

index of the point to check (must be between 0 and n-1)

Returns:boolean

true if the point is exactly between its neighbors

org.apache.commons.math3.geometry.euclidean.threed back to summary

private Class OutlineExtractor.BoundaryProjector

extends Object
implements BSPTreeVisitor<Euclidean3D>
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.geometry.euclidean.threed.OutlineExtractor.BoundaryProjector
All Implemented Interfaces
org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor

Visitor projecting the boundary facets on a plane.

Field Summary

Modifier and TypeField and Description
private PolygonsSet
projected

Projection of the polyhedrons set on the plane.

private final double
tolerance

Tolerance below which points are considered identical.

Constructor Summary

AccessConstructor and Description
pack-priv
BoundaryProjector(final double
tolerance below which points are considered identical
tolerance
)

Simple constructor.

Method Summary

Modifier and TypeMethod and Description
private void
addContribution(final SubHyperplane<Euclidean3D>
boundary facet
facet
,
final boolean
if true, the facet has the inside on its plus side
reversed
)

Add he contribution of a boundary facet.

public PolygonsSet

Returns:

projection of the polyhedrons set on the plane
getProjected
()

Get the projection of the polyhedrons set on the plane.

public void
visitInternalNode(final BSPTree<Euclidean3D>
BSP node guaranteed to have a non null cut sub-hyperplane
node
)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitInternalNode.

Visit a BSP tree node node having a non-null sub-hyperplane.

public void
visitLeafNode(final BSPTree<Euclidean3D>
leaf BSP node having a null sub-hyperplane
node
)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitLeafNode.

Visit a leaf BSP tree node node having a null sub-hyperplane.

public BSPTreeVisitor.Order
visitOrder(final BSPTree<Euclidean3D>
BSP node guaranteed to have a non null cut sub-hyperplane
node
)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitOrder.

Determine the visit order for this node.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

projectedback to summary
private PolygonsSet projected

Projection of the polyhedrons set on the plane.

toleranceback to summary
private final double tolerance

Tolerance below which points are considered identical.

Constructor Detail

BoundaryProjectorback to summary
pack-priv BoundaryProjector(final double tolerance)

Simple constructor.

Parameters
tolerance:double

tolerance below which points are considered identical

Method Detail

addContributionback to summary
private void addContribution(final SubHyperplane<Euclidean3D> facet, final boolean reversed)

Add he contribution of a boundary facet.

Parameters
facet:SubHyperplane<Euclidean3D>

boundary facet

reversed:boolean

if true, the facet has the inside on its plus side

getProjectedback to summary
public PolygonsSet getProjected()

Get the projection of the polyhedrons set on the plane.

Returns:PolygonsSet

projection of the polyhedrons set on the plane

visitInternalNodeback to summary
public void visitInternalNode(final BSPTree<Euclidean3D> node)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitInternalNode.

Doc from org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitInternalNode.

Visit a BSP tree node node having a non-null sub-hyperplane.

It is guaranteed that this method will be called after visitOrder has been called for a given node, it wil be called exactly once for each internal node.

Parameters
node:BSPTree<Euclidean3D>

BSP node guaranteed to have a non null cut sub-hyperplane

visitLeafNodeback to summary
public void visitLeafNode(final BSPTree<Euclidean3D> node)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitLeafNode.

Doc from org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitLeafNode.

Visit a leaf BSP tree node node having a null sub-hyperplane.

Parameters
node:BSPTree<Euclidean3D>

leaf BSP node having a null sub-hyperplane

visitOrderback to summary
public BSPTreeVisitor.Order visitOrder(final BSPTree<Euclidean3D> node)

Implements org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitOrder.

Doc from org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor.visitOrder.

Determine the visit order for this node.

Before attempting to visit an internal node, this method is called to determine the desired ordering of the visit. It is guaranteed that this method will be called before visitInternalNode for a given node, it will be called exactly once for each internal node.

Parameters
node:BSPTree<Euclidean3D>

BSP node guaranteed to have a non null cut sub-hyperplane

Returns:BSPTreeVisitor.Order

desired visit order, must be one of Order#PLUS_MINUS_SUB, Order#PLUS_SUB_MINUS, Order#MINUS_PLUS_SUB, Order#MINUS_SUB_PLUS, Order#SUB_PLUS_MINUS, Order#SUB_MINUS_PLUS