anar

Class Pts

java.lang.Object
  extended by anar.Parametric
      extended by anar.Pts
All Implemented Interfaces:
iTaggable, iTransformable
Direct Known Subclasses:
Camera, CSpline, CSplineB, Face, FrenetFrame, Line, PtsMid, SplineSurf, SplineSurf2

public class Pts
extends Parametric
implements iTransformable

Points List and Faces

In ANAR library, lines(segments), multilines(polylines) and faces share a common data structure. The structure relies on a list of points. Depending on the object, they have different behaviors. The major distinction between face and polylines is the way how faces are displayed. Face will act as closed polyline. It is assumed that faces could be non-planar. If the face is not described as planar, the display method to provide a method to display non-planar faces.


Field Summary
static RenderPts globalRender
           
 Meta meta
           
 java.util.ArrayList<Pt> ptList
           
 RenderPts render
           
 
Constructor Summary
Pts()
           
Pts(Pt... ps)
          Vararg.
Pts(Pt a, Pt b)
           
Pts(Pt a, Pt b, Pt c)
           
Pts(Pts pts)
           
Pts(Pts ptsIn, Transform transform)
           
 
Method Summary
 Pts add(float x, float y)
           
 Pts add(float x, float y, float z)
           
 Pts add(int index, Pt p)
           
 Pts add(int index, Pts pts)
           
 Pts add(Pt... pts)
           
 Pts add(Pt p)
           
 Pts add(Pts pts)
           
 Pts add(XYZ p)
           
 void addPointsFrom(Pts pts)
           
 Pts apply(Transform t)
           
 float area()
           
static float area(Pts pts)
           
 XYZ[] bound()
           
 XYZ boundCenter()
           
 void color(AColor color)
          change the stroke color
 void color(float gray)
           
 void color(float gray, float alpha)
           
 void color(float red, float green, float blue)
           
 void color(float red, float green, float blue, float alpha)
           
 Pts copy()
           
 Pts discretization(int n)
          Return a set of points placed on the line.
 void draw()
           
 void drawPoints()
           
 Pts flip()
           
 Pt get(int i)
          Deprecated replaced by pt(int)}
 Pt getPt(int i)
          Deprecated replaced by pt(int)}
 boolean inLine(XYZ p)
           
 java.util.Iterator<Pt> iterator()
           
 float length()
           
 int numOfPts()
           
 Pts orphaned()
          Export the geometry without any Parametric features.
 Pt pt(int i)
          Get the point i in the list.
 Pt ptEnd()
          Return the last point in the list.
 Pt ptEnd(int i)
          Return the point i in the list beginning by the end.
 Pt ptMod(int i)
          Get the point i%numOfPts() in the list.
 float[] ptOnCurve(float t)
           
 Pt remove(int i)
           
 Pt remove(Pt p)
           
 Pts render(RenderPt render)
          Change the render for this object.
 Pts render(RenderPts render)
          Change the render for this object.
 Pts reverse()
           
 Pts rotateX(float v)
           
 Pts rotateX(Param v)
           
 Pts rotateY(float v)
           
 Pts rotateY(Param v)
           
 Pts rotateZ(float v)
           
 Pts rotateZ(Param v)
           
 Pts scale(float x)
           
 Pts scale(float x, float y)
           
 Pts scale(float x, float y, float z)
           
 Pts scale(Param x)
           
 Pts scale(Param x, Param y)
           
 Pts scale(Param x, Param y, Param z)
           
 Pts scale(Pt p)
           
 Pts scale(XYZ vector)
           
 Pts scaleX(float x)
           
 Pts scaleX(Param x)
           
 Pts scaleY(float y)
           
 Pts scaleY(Param y)
           
 Pts scaleZ(float z)
           
 Pts scaleZ(Param z)
           
 Pts set(Meta meta)
           
 Pts set(java.lang.String tag)
           
 Pts setMeta(Meta meta)
           
 int size()
          Deprecated replaced by numOfPts()}
 Pts stroke(AColor c)
           
 Pts stroke(float g)
           
 Pts stroke(float g, float a)
           
 Pts stroke(float r, float g, float b)
           
 Pts stroke(float r, float g, float b, float a)
           
 Pts tag(Meta tag)
           
 Pts tag(java.lang.String tag)
           
 java.lang.String toANSYS()
           
 java.lang.String toAutocad()
           
 java.lang.String toMegaPOVLink()
           
 java.lang.String toObjExporter()
           
 java.lang.String toObjExporter(java.lang.String name)
           
 java.lang.String toPovRayAsArray(java.lang.String arrayName)
           
 java.lang.String toPovRayAsCylinder()
           
 java.lang.String toRadianceAsCylinder()
          Export a Pts to Radiance as a sequence of cylinders Output example:
 java.lang.String toRhino()
           
 java.lang.String toRhinoAsObject()
           
 java.lang.String toSketchUp()
           
 java.lang.String toString()
           
 Pts translate(float x, float y)
           
 Pts translate(float x, float y, float z)
           
 Pts translate(Param x, Param y)
           
 Pts translate(Param x, Param y, Param z)
           
 Pts translate(Pt p)
           
 Pts translate(XYZ vector)
           
 Pts translateX(float x)
           
 Pts translateX(Param x)
           
 Pts translateY(float y)
           
 Pts translateY(Param y)
           
 Pts translateZ(float z)
           
 Pts translateZ(Param z)
           
 
Methods inherited from class anar.Parametric
child, getMeta, getPrimitive, parent, parent, parentList, parentList, parentList, parentListGraphViz, parentListGraphViz, parentListRecursive, parentListRecursiveGraphViz, parentToString, parentToStringRecursive, parentToStringRecursive, primitiveToString, replaceParent, replaceParent, replicate, tag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

globalRender

public static RenderPts globalRender

render

public RenderPts render

meta

public Meta meta

ptList

public java.util.ArrayList<Pt> ptList
Constructor Detail

Pts

public Pts()

Pts

public Pts(Pt a,
           Pt b)

Pts

public Pts(Pt a,
           Pt b,
           Pt c)

Pts

public Pts(Pt... ps)
Vararg.

Parameters:
ps -

Pts

public Pts(Pts pts)
Parameters:
pts -

Pts

public Pts(Pts ptsIn,
           Transform transform)
Parameters:
ptsIn -
transform -
Method Detail

copy

public Pts copy()
Returns:

pt

public Pt pt(int i)
Get the point i in the list.

Parameters:
i - - number of the point in the sequence
Returns:

ptMod

public Pt ptMod(int i)
Get the point i%numOfPts() in the list. Could be negative. The list is a closed sequence. Equivalent to pt((i%numOfPts()+numOfPts())%numOfPts());

Parameters:
i -
Returns:
See Also:
pt(int)

ptEnd

public Pt ptEnd()
Return the last point in the list.

Returns:

ptEnd

public Pt ptEnd(int i)
Return the point i in the list beginning by the end.

Parameters:
i -
Returns:

get

@Deprecated
public Pt get(int i)
Deprecated replaced by pt(int)}

Overrides:
get in class Parametric

getPt

@Deprecated
public Pt getPt(int i)
Deprecated replaced by pt(int)}


size

public int size()
Deprecated replaced by numOfPts()}


numOfPts

public int numOfPts()

remove

public Pt remove(int i)
Parameters:
i -

remove

public Pt remove(Pt p)

iterator

public java.util.Iterator<Pt> iterator()
Returns:

add

public Pts add(float x,
               float y,
               float z)

add

public Pts add(float x,
               float y)

add

public Pts add(XYZ p)

add

public Pts add(Pt p)

add

public Pts add(int index,
               Pt p)

add

public Pts add(Pt... pts)

add

public Pts add(Pts pts)

add

public Pts add(int index,
               Pts pts)

reverse

public Pts reverse()

flip

public Pts flip()

addPointsFrom

public void addPointsFrom(Pts pts)
Parameters:
pts -

rotateX

public Pts rotateX(Param v)

rotateX

public Pts rotateX(float v)

rotateY

public Pts rotateY(Param v)

rotateY

public Pts rotateY(float v)

rotateZ

public Pts rotateZ(Param v)

rotateZ

public Pts rotateZ(float v)

scale

public Pts scale(XYZ vector)

scale

public Pts scale(Pt p)

scale

public Pts scale(float x,
                 float y,
                 float z)

scale

public Pts scale(float x)

scale

public Pts scale(float x,
                 float y)

scale

public Pts scale(Param x,
                 Param y,
                 Param z)

scale

public Pts scale(Param x,
                 Param y)

scale

public Pts scale(Param x)

scaleX

public Pts scaleX(float x)

scaleX

public Pts scaleX(Param x)

scaleY

public Pts scaleY(float y)

scaleY

public Pts scaleY(Param y)

scaleZ

public Pts scaleZ(float z)

scaleZ

public Pts scaleZ(Param z)

translate

public Pts translate(XYZ vector)

translate

public Pts translate(Pt p)

translate

public Pts translate(float x,
                     float y)

translate

public Pts translate(float x,
                     float y,
                     float z)

translate

public Pts translate(Param x,
                     Param y)

translate

public Pts translate(Param x,
                     Param y,
                     Param z)

translateX

public Pts translateX(float x)
Parameters:
x -

translateX

public Pts translateX(Param x)
Parameters:
x -

translateY

public Pts translateY(float y)
Parameters:
x -

translateY

public Pts translateY(Param y)
Parameters:
x -

translateZ

public Pts translateZ(float z)
Parameters:
x -

translateZ

public Pts translateZ(Param z)
Parameters:
x -

apply

public Pts apply(Transform t)

draw

public void draw()

area

public static float area(Pts pts)

area

public float area()

length

public float length()
Returns:

stroke

public Pts stroke(float g)

stroke

public Pts stroke(float g,
                  float a)

stroke

public Pts stroke(float r,
                  float g,
                  float b)

stroke

public Pts stroke(float r,
                  float g,
                  float b,
                  float a)

stroke

public Pts stroke(AColor c)

render

public Pts render(RenderPts render)
Change the render for this object.

Parameters:
render -
Returns:

render

public Pts render(RenderPt render)
Change the render for this object.

Parameters:
render -
Returns:

orphaned

public Pts orphaned()
Export the geometry without any Parametric features. The geometry becomes static and loose all dynamic relationships between objects. Become all Pt derived or linked to antoher becomes x y z, Faces and Pts are set of static points.


discretization

public Pts discretization(int n)
Return a set of points placed on the line. This is similar to break the line down into a number of segments. This work the similarly on straightlines and on curves

Parameters:
n -
Returns:

drawPoints

public void drawPoints()

set

public Pts set(Meta meta)
Specified by:
set in interface iTaggable

set

public Pts set(java.lang.String tag)
Parameters:
string -

setMeta

public Pts setMeta(Meta meta)
Specified by:
setMeta in interface iTaggable

tag

public Pts tag(java.lang.String tag)
Specified by:
tag in interface iTaggable

tag

public Pts tag(Meta tag)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

color

public void color(float gray)

color

public void color(float gray,
                  float alpha)

color

public void color(float red,
                  float green,
                  float blue)

color

public void color(float red,
                  float green,
                  float blue,
                  float alpha)

color

public void color(AColor color)
change the stroke color

Parameters:
color -

toANSYS

public java.lang.String toANSYS()

toAutocad

public java.lang.String toAutocad()

toMegaPOVLink

public java.lang.String toMegaPOVLink()

toPovRayAsCylinder

public java.lang.String toPovRayAsCylinder()

toRadianceAsCylinder

public java.lang.String toRadianceAsCylinder()
Export a Pts to Radiance as a sequence of cylinders Output example:
            material cylinder name
                0
                0
                7       1454.1045       140.25954       0
                        1448.2742       142.885 0
                        10
 

Returns:
String of code (MultiLines)

ptOnCurve

public float[] ptOnCurve(float t)

toPovRayAsArray

public java.lang.String toPovRayAsArray(java.lang.String arrayName)

toRhino

public java.lang.String toRhino()
Returns:

toRhinoAsObject

public java.lang.String toRhinoAsObject()
Returns:

toSketchUp

public java.lang.String toSketchUp()
Returns:

toObjExporter

public java.lang.String toObjExporter()

toObjExporter

public java.lang.String toObjExporter(java.lang.String name)

inLine

public boolean inLine(XYZ p)

bound

public XYZ[] bound()
Returns:
the smallest bounding box enclosing the group in XYZ.

boundCenter

public XYZ boundCenter()
Returns:
the point in the middle of the smallest enclosing box.