- All Superinterfaces:
Shape3D
- All Known Implementing Classes:
Model3D
Class providing basic operations for a Model3D.
The operations included are ones needed to add objects
to a model.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Interface providing basic operations for triangles. -
Method Summary
Modifier and TypeMethodDescriptionaddFlippedTriangle
(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) Add a flipped triangle to the model, specifying the triangle by its vertices.addFlippedTriangle
(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color) Add a flipped triangle to the model, specifying the triangle by its vertices and color.addFlippedTriangle
(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color, Object tag) Add a flipped triangle to the model, specifying the triangle by its vertices and color, also specifying a tag.void
addModel
(Model3DOps<?> m3d) Add an existing model to this model.void
addModel
(Model3DOps<?> m3d, Object tag) Add an existing model to this model, providing a tag.addTriangle
(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) Add a triangle to the model, specifying the triangle by its vertices.addTriangle
(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color) Add a triangle to the model, specifying the triangle by its vertices and its color.addTriangle
(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color, Object tag) Add a triangle to the model, specifying the triangle by its vertices and its color, also specifying a tag.addTriangle
(Model3DOps.Triangle triangle) Add a triangle to the model.Methods inherited from interface org.bzdev.geom.Shape3D
getBoundary, getBoundary, getBounds, getComponent, getSurfaceIterator, getSurfaceIterator, isClosedManifold, isOriented, numberOfComponents
-
Method Details
-
addModel
Add an existing model to this model.- Parameters:
m3d
- the model to add
-
addModel
Add an existing model to this model, providing a tag.- Parameters:
m3d
- the model to addtag
- the tag naming the objects in this model
-
addTriangle
Add a triangle to the model. The triangle that is stored may differ from the triangle passed as this method's argument: while the type may be different, some classes that implement Model3DOps can apply transformations and will need to create a different triangle as a result.- Parameters:
triangle
- the triangle to add- Returns:
- the triangle stored by this model
-
addTriangle
T addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) throws IllegalArgumentException Add a triangle to the model, specifying the triangle by its vertices. The orientation of the triangle is determined by the right-hand rule when going from vertex 1 to vertex 2 to vertex 3.- Parameters:
x1
- the x coordinate of vertex 1y1
- the y coordinate of vertex 1z1
- the z coordinate of vertex 1x2
- the x coordinate of vertex 2y2
- the y coordinate of vertex 2z2
- the z coordinate of vertex 2x3
- the x coordinate of vertex 3y3
- the y coordinate of vertex 3z3
- the z coordinate of vertex 3- Returns:
- the triangle stored by this model
- Throws:
IllegalArgumentException
- one of the first 9 arguments had the value Double.NaN
-
addFlippedTriangle
T addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) throws IllegalArgumentException Add a flipped triangle to the model, specifying the triangle by its vertices. The orientation of the triangle is the opposite to what the right-hand rule when going from vertex 1 to vertex 2 to vertex 3 would suggest.- Parameters:
x1
- the x coordinate of vertex 1y1
- the y coordinate of vertex 1z1
- the z coordinate of vertex 1x2
- the x coordinate of vertex 2y2
- the y coordinate of vertex 2z2
- the z coordinate of vertex 2x3
- the x coordinate of vertex 3y3
- the y coordinate of vertex 3z3
- the z coordinate of vertex 3- Returns:
- the triangle stored by this model
- Throws:
IllegalArgumentException
- one of the first 9 arguments had the value Double.NaN
-
addTriangle
T addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color) throws IllegalArgumentException Add a triangle to the model, specifying the triangle by its vertices and its color. The orientation of the triangle is determined by the right-hand rule when going from vertex 1 to vertex 2 to vertex 3.- Parameters:
x1
- the x coordinate of vertex 1y1
- the y coordinate of vertex 1z1
- the z coordinate of vertex 1x2
- the x coordinate of vertex 2y2
- the y coordinate of vertex 2z2
- the z coordinate of vertex 2x3
- the x coordinate of vertex 3y3
- the y coordinate of vertex 3z3
- the z coordinate of vertex 3color
- the color of the triangle; null if none is specified- Returns:
- the triangle stored by this model
- Throws:
IllegalArgumentException
- one of the first 9 arguments had the value Double.NaN
-
addFlippedTriangle
T addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color) throws IllegalArgumentException Add a flipped triangle to the model, specifying the triangle by its vertices and color. The orientation of the triangle is the opposite to what the right-hand rule when going from vertex 1 to vertex 2 to vertex 3 would suggest.- Parameters:
x1
- the x coordinate of vertex 1y1
- the y coordinate of vertex 1z1
- the z coordinate of vertex 1x2
- the x coordinate of vertex 2y2
- the y coordinate of vertex 2z2
- the z coordinate of vertex 2x3
- the x coordinate of vertex 3y3
- the y coordinate of vertex 3z3
- the z coordinate of vertex 3color
- the color of the triangle; null if none is specified- Returns:
- the triangle stored by this model
- Throws:
IllegalArgumentException
- one of the first 9 arguments had the value Double.NaN
-
addTriangle
T addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color, Object tag) throws IllegalArgumentException Add a triangle to the model, specifying the triangle by its vertices and its color, also specifying a tag. The orientation of the triangle is determined by the right-hand rule when going from vertex 1 to vertex 2 to vertex 3.- Parameters:
x1
- the x coordinate of vertex 1y1
- the y coordinate of vertex 1z1
- the z coordinate of vertex 1x2
- the x coordinate of vertex 2y2
- the y coordinate of vertex 2z2
- the z coordinate of vertex 2x3
- the x coordinate of vertex 3y3
- the y coordinate of vertex 3z3
- the z coordinate of vertex 3color
- the color of the triangle; null if none is specifiedtag
- the tag; null if there is none- Returns:
- the triangle stored by this model
- Throws:
IllegalArgumentException
- a tag was a triangle or one of the first 9 arguments had the value Double.NaN
-
addFlippedTriangle
T addFlippedTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, Color color, Object tag) throws IllegalArgumentException Add a flipped triangle to the model, specifying the triangle by its vertices and color, also specifying a tag. The orientation of the triangle is the opposite to what the right-hand rule when going from vertex 1 to vertex 2 to vertex 3 would suggest.- Parameters:
x1
- the x coordinate of vertex 1y1
- the y coordinate of vertex 1z1
- the z coordinate of vertex 1x2
- the x coordinate of vertex 2y2
- the y coordinate of vertex 2z2
- the z coordinate of vertex 2x3
- the x coordinate of vertex 3y3
- the y coordinate of vertex 3z3
- the z coordinate of vertex 3color
- the color of the triangle; null if none is specifiedtag
- the tag; null if there is none- Returns:
- the triangle stored by this model
- Throws:
IllegalArgumentException
- a tag was a triangle or one of the first 9 arguments had the value Double.NaN
-