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 floataFloat()Generate a float between 0 and 1floataFloat(float range)Generate a float between 0 and rangeColorcolor()Colorcolor(Coord3d coord)Build a color based on the input coord values.Colorcolor(Coord3d coord, float xrange, float yrange, float zrange)Coord3dcoord()Coord3dcoord(float xrange, float yrange, float zrange)Compositecube()Compositecube(int xyz)Compositecube(int x, int y, int z)Compositecube(int x, int y, int z, int w, int h, int d)List<Composite>cubes(int cubes)booleanisAlpha()Polygonpoly(int x, int y, int z)Polygonpoly(int x, int y, int z, boolean leftRightOrNearFar, Color color)Polygonpoly(int x, int y, int z, int w, int h)Polygonpoly(int x, int y, int z, int w, int h, boolean leftRightOrNearFar, Color color)Return a polygon at specified position, width and height.voidsetAlpha(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.Coord3dviewpoint()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 aCompositewhich in returned in a list ofDrawables.- 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)
-
-