Package org.jzy3d.plot3d.primitives
Class RandomGeom
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.RandomGeom
-
public class RandomGeom extends Object
-
-
Constructor Summary
Constructors Constructor Description RandomGeom()
RandomGeom(long seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
aFloat()
Generate a float between 0 and 1float
aFloat(float range)
Generate a float between 0 and rangeColor
color()
Color
color(Coord3d coord)
Build a color based on the input coord values.Color
color(Coord3d coord, float xrange, float yrange, float zrange)
Coord3d
coord()
Coord3d
coord(float xrange, float yrange, float zrange)
Composite
cube()
Composite
cube(int xyz)
Composite
cube(int x, int y, int z)
Composite
cube(int x, int y, int z, int w, int h, int d)
List<Composite>
cubes(int cubes)
boolean
isAlpha()
Polygon
poly(int x, int y, int z)
Polygon
poly(int x, int y, int z, boolean leftRightOrNearFar, Color color)
Polygon
poly(int x, int y, int z, int w, int h)
Polygon
poly(int x, int y, int z, int w, int h, boolean leftRightOrNearFar, Color color)
Return a polygon at specified position, width and height.void
setAlpha(boolean alpha)
List<Composite>
spinningCubes(int cubes, float spin)
List<Composite>
spinningCubes(int cubes, float spin, float randomize)
Generate a stack of cubes, where the top face is spinned w.r.t. the bottom face.Coord3d
viewpoint()
generate a random viewpoint according to the expected values ofView.setViewPoint(Coord3d, boolean)
-
-
-
Method Detail
-
isAlpha
public boolean isAlpha()
-
setAlpha
public void setAlpha(boolean alpha)
-
coord
public Coord3d coord()
-
coord
public Coord3d coord(float xrange, float yrange, float zrange)
-
color
public Color color()
-
viewpoint
public Coord3d viewpoint()
generate a random viewpoint according to the expected values ofView.setViewPoint(Coord3d, boolean)
-
aFloat
public float aFloat()
Generate a float between 0 and 1
-
aFloat
public float aFloat(float range)
Generate a float between 0 and range
-
spinningCubes
public List<Composite> spinningCubes(int cubes, float spin, float randomize)
Generate a stack of cubes, where the top face is spinned w.r.t. the bottom face. The left, right, near and far faces are consequently not planar which is usefull to validate some algorithms. Each cube is aComposite
which in returned in a list ofDrawable
s.- Parameters:
cubes
- number of cubes in the stackspin
- the rotation angle in degree between the bottom and top facerandomize
- is the factor applied to a random number generator before adding a "shaking" offset to each coordinate
-
cube
public Composite cube(int x, int y, int z, int w, int h, int d)
- Parameters:
x
- starting point Xy
- starting point Yz
- starting point Zw
- width (allows building ending point X)h
- height (allows building ending point Y)d
- depth (allows building ending point Z)
-
cube
public Composite cube(int x, int y, int z)
-
cube
public Composite cube(int xyz)
-
cube
public Composite cube()
-
poly
public Polygon poly(int x, int y, int z)
-
poly
public Polygon poly(int x, int y, int z, int w, int h, boolean leftRightOrNearFar, Color color)
Return a polygon at specified position, width and height. Width is either applied to X or Z according to the boolean parameter.- Parameters:
x
-y
-z
-w
- widthh
- heightleftRightOrNearFar
- if true, width is applied along X, otherwise along Z dimension.color
-- Returns:
-
poly
public Polygon poly(int x, int y, int z, int w, int h)
-
-