anar

Class Pt

java.lang.Object
  extended by anar.Parametric
      extended by anar.Pt
All Implemented Interfaces:
iArithmetic, iTaggable, iTransformable, XYZ
Direct Known Subclasses:
PtABS, PtBary, PtCenter, PtCircumCenter, PtCircumSphereCenter, PtCross, PtCurve, PtDarboux, PtDER, PtIntersect, PtMid, PtNormal, PtNormalize, PtProj, PtVector

public abstract class Pt
extends Parametric
implements XYZ, iTransformable

Absolute Points

Points combine n parameters (representing coordinates values) according to the dimension of a point. 2 parameters is considered as 2D point, 3 parameters is considered as 3D. A point could contain the same parameter twice resulting in a constrained point on xy slope.

Derived points

Derived points are depending on their parents, contrary to absolute points, they couldn't be modified directly as they are the result of a relationship. This is used to express relationship such as points in the middle of two points, intersection between two lines or three planes, center of a face, transformed point (see Transform primitives), points constrained on a line.

Class wrapper for all the Points. This is the main class you should interract with. The constructors here (create) will provide the right type of point. This class is used in three subClasses: [Vertex] Static class - no automation - plain linear maths [PtABS] Provide Points where X,Y,Z are a parametric value - (primitives) [PtDer] Provide a class where a point is rebuilt from an another one. They enable transformations. The common Properties are the XYZ coordinates. (in Double is better for rotations) They have accessors equivalent to getX() --> x() (more simple form)


Field Summary
static RenderPt globalRender
          A default render node is provided for all the class.
 RenderPt render
          Overide the globalRender.
 
Fields inherited from class anar.Parametric
meta
 
Constructor Summary
Pt()
           
Pt(Pt p)
           
 
Method Summary
 Pt apply(Transform t)
           
 XYZ[] bound()
           
 XYZ boundCenter()
           
 Pt copy()
           
static PtABS create(float x)
          Deprecated replaced by Anar.Pt(float)
static PtABS create(float x, float y)
          Deprecated replaced by Anar.Pt(float,float)
static PtABS create(float x, float y, float z)
          Deprecated replaced by Anar.Pt(float,float,float)
static PtABS create(float x, float y, float z, java.lang.String name)
          Deprecated replaced by Anar.Pt(float,float,float,String)
static PtABS create(Param x, Param y)
          Deprecated replaced by Anar.Pt(float,float)
static PtABS create(Param x, Param y, Param z)
          Deprecated replaced by Anar.Pt(float,float,float)
static PtDER create(Pt p)
          Deprecated replaced by Anar.Pt(Pt)
static PtDER create(Pt p, java.lang.String name)
          Deprecated replaced by Anar.Pt(Pt,String)
static PtDER create(Pt ori, Transform t)
          Deprecated replaced by Anar.Pt(Pt,Transform)
static PtDER create(Pt ori, Transform t, java.lang.String name)
          Deprecated replaced by Anar.Pt(Pt,Transform)
static Pt create(Vertex t)
           
static PtABS create(XYZ p)
          Deprecated replaced by Anar.Pt(XYZ)
static PtABS createNull(float x, float y, float z)
          Deprecated replaced by Anar.PtNull(float,float,float)
static Pt createRnd(int x)
          Deprecated replaced by Anar.PtRnd(float)
static Pt createRnd(int x, int y)
          Deprecated replaced by Anar.PtRnd(float,float)
static Pt createRnd(int x, int y, int z)
          Deprecated replaced by Anar.PtRnd(float,float,float)
 PtDER divide(float kk)
           
 PtDER divide(float k, float l)
           
 PtDER divide(float k, float l, float m)
           
 PtDER divide(XYZ p)
           
 float dot(XYZ v)
           
static float dot(XYZ v0, XYZ v1)
           
 void draw()
          Call draw() from the render (might have been changed)
 boolean equalsPt(XYZ v)
           
 boolean equalsPt(XYZ v, float clamping)
           
 void fill(AColor c)
           
 void fill(float g)
           
 void fill(float g, float a)
           
 void fill(float r, float g, float b)
           
 void fill(float r, float g, float b, float a)
           
 void fill(RenderPtCross c)
           
 void fillP5(int c)
           
 Transform getTransform()
           
 boolean isOver()
          Test if the mouse is over this coordinate.
 boolean isOver(float dist)
          Test if the mouse is over this coordinate.
 float length()
           
 float length(XYZ p)
           
static float length(XYZ p, XYZ q)
           
static float lengthNoSq(XYZ p, XYZ q)
           
 float lengthSq()
           
 float lengthSq(XYZ p)
           
 PtDER minus(float k)
           
 PtDER minus(float k, float l)
           
 PtDER minus(float k, float l, float m)
           
 PtDER minus(Pt p)
           
 PtDER minus(XYZ p)
           
 PtDER multiply(float k)
           
 PtDER multiply(float k, float l)
           
 PtDER multiply(float k, float l, float m)
           
 PtDER multiply(Pt p)
           
 PtDER multiply(XYZ p)
           
 Vertex onScreen()
           
 Pt orphaned()
          Export the geometry without any Parametric features.
 PtDER plus(float k)
           
 PtDER plus(float k, float l)
           
 PtDER plus(float k, float l, float m)
           
 PtDER plus(Pt p)
           
 java.lang.String plus(java.lang.String s)
           
 PtDER plus(XYZ p)
           
 Pt render(RenderPt render)
          Change the render for this object.
 Pt rotateX(float x)
           
 Pt rotateX(Param v)
           
 Pt rotateY(float y)
           
 Pt rotateY(Param v)
           
 Pt rotateZ(float z)
           
 Pt rotateZ(Param v)
           
 Pt scale(float x)
           
 Pt scale(float x, float y)
           
 Pt scale(float x, float y, float z)
           
 Pt scale(Param x)
           
 Pt scale(Param x, Param y)
           
 Pt scale(Param x, Param y, Param z)
           
 Pt scale(Pt p)
           
 Pt scale(XYZ p)
           
 Pt scaleX(float x)
           
 Pt scaleX(Param x)
           
 Pt scaleY(float y)
           
 Pt scaleY(Param y)
           
 Pt scaleZ(float z)
           
 Pt scaleZ(Param z)
           
 void set(float x)
           
 void set(float x, float y)
           
 void set(float x, float y, float z)
           
 Pt set(Meta meta)
           
 void set(Param x)
           
 void set(Param x, Param y)
           
 void set(Param x, Param y, Param z)
           
 Pt set(Transform _t)
          Deprecated 
 void set(XYZ p)
           
 Pt setMeta(Meta meta)
           
 Pt tag(Meta tag)
           
 Pt tag(java.lang.String tag)
           
 java.lang.String toANSYS()
           
 java.lang.String toAutocad()
           
 java.lang.String toAutocadPart()
           
 java.lang.String toMegaPPOV()
           
 java.lang.String toObjExporter()
           
 java.lang.String toObjExporterAsObject()
           
 java.lang.String toPovRay()
           
 java.lang.String toPovRayAsObject()
           
 java.lang.String toRadiance()
           
 java.lang.String toRadianceAsObject()
          Export a Pt to Radiance as a sphere Output example:
 java.lang.String toRhino()
           
 java.lang.String toRhinoAsObject()
           
 java.lang.String toRhinoAsVar()
           
 java.lang.String toShortString()
           
 java.lang.String toSingleName()
           
 java.lang.String toSketchUp()
           
 java.lang.String toSketchUpAsPoint3D()
           
 java.lang.String toString()
           
 java.lang.String toStringComa()
           
 java.lang.String toStringComaPovRay()
           
 java.lang.String toStringTab()
           
 java.lang.String toStringTabRad()
           
 Pt translate(float x, float y)
           
 Pt translate(float x, float y, float z)
           
 Pt translate(Param x, Param y)
           
 Pt translate(Param x, Param y, Param z)
           
 Pt translate(Pt p)
           
 Pt translate(XYZ p)
           
 Pt translateX(float x)
           
 Pt translateX(Param x)
           
 Pt translateY(float y)
           
 Pt translateY(Param y)
           
 Pt translateZ(float z)
           
 Pt translateZ(Param z)
           
 float x()
          getter.
 void x(float x)
           
 void x(Param x)
           
 float y()
           
 void y(float y)
           
 void y(Param y)
           
 float z()
           
 void z(float z)
           
 void z(Param z)
           
 
Methods inherited from class anar.Parametric
child, get, 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 RenderPt globalRender
A default render node is provided for all the class. If render is not provided, global is used.


render

public RenderPt render
Overide the globalRender. See RenderPt class. RenderPt use P5

Constructor Detail

Pt

public Pt()

Pt

public Pt(Pt p)
Method Detail

getTransform

public Transform getTransform()

create

@Deprecated
public static PtABS create(float x,
                                      float y,
                                      float z)
Deprecated replaced by Anar.Pt(float,float,float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
#Pt(float,float,float)

create

@Deprecated
public static PtABS create(XYZ p)
Deprecated replaced by Anar.Pt(XYZ)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(XYZ)

create

@Deprecated
public static PtABS create(float x,
                                      float y,
                                      float z,
                                      java.lang.String name)
Deprecated replaced by Anar.Pt(float,float,float,String)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(float,float,float,String)

create

@Deprecated
public static PtABS create(Param x,
                                      Param y)
Deprecated replaced by Anar.Pt(float,float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(float,float,float)

create

@Deprecated
public static PtABS create(Param x,
                                      Param y,
                                      Param z)
Deprecated replaced by Anar.Pt(float,float,float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(float,float,float)

create

@Deprecated
public static PtABS create(float x,
                                      float y)
Deprecated replaced by Anar.Pt(float,float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(float,float)

create

@Deprecated
public static PtABS create(float x)
Deprecated replaced by Anar.Pt(float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(float)

create

@Deprecated
public static PtDER create(Pt p)
Deprecated replaced by Anar.Pt(Pt)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(Pt)

create

@Deprecated
public static PtDER create(Pt p,
                                      java.lang.String name)
Deprecated replaced by Anar.Pt(Pt,String)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(Pt,String)

create

@Deprecated
public static PtDER create(Pt ori,
                                      Transform t)
Deprecated replaced by Anar.Pt(Pt,Transform)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(Pt,Transform)

create

@Deprecated
public static PtDER create(Pt ori,
                                      Transform t,
                                      java.lang.String name)
Deprecated replaced by Anar.Pt(Pt,Transform)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.Pt(Pt,Transform)

createNull

@Deprecated
public static PtABS createNull(float x,
                                          float y,
                                          float z)
Deprecated replaced by Anar.PtNull(float,float,float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.PtNull(float,float,float)

createRnd

@Deprecated
public static Pt createRnd(int x,
                                      int y,
                                      int z)
Deprecated replaced by Anar.PtRnd(float,float,float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
Anar.PtNull(float,float,float)

createRnd

@Deprecated
public static Pt createRnd(int x,
                                      int y)
Deprecated replaced by Anar.PtRnd(float,float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
anar.Anar#PtNull(float,float)

createRnd

@Deprecated
public static Pt createRnd(int x)
Deprecated replaced by Anar.PtRnd(float)

Removed - please use new Pt() instead. This is kept for backward compatibility.

See Also:
anar.Anar#PtNull(float)

x

public float x()
getter. Similar to get() or getX(). As the x field is private (might need to be updated), this is the way to read infos.

Specified by:
x in interface XYZ
Returns:
x (float)

y

public float y()
Specified by:
y in interface XYZ

z

public float z()
Specified by:
z in interface XYZ

draw

public void draw()
Call draw() from the render (might have been changed)

Specified by:
draw in interface XYZ

fill

public void fill(float g)

fill

public void fill(float g,
                 float a)

fill

public void fill(float r,
                 float g,
                 float b)

fill

public void fill(float r,
                 float g,
                 float b,
                 float a)

fillP5

public void fillP5(int c)

fill

public void fill(AColor c)

fill

public void fill(RenderPtCross c)

render

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

Parameters:
render -
Returns:

onScreen

public Vertex onScreen()

isOver

public boolean isOver(float dist)
Test if the mouse is over this coordinate.

Parameters:
dist - - Minimal distance near the point.
Returns:

isOver

public boolean isOver()
Test if the mouse is over this coordinate.

Returns:

orphaned

public Pt 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.


set

@Deprecated
public Pt set(Transform _t)
Deprecated 

Parameters:
_t -

rotateX

public Pt rotateX(float x)

rotateY

public Pt rotateY(float y)

rotateZ

public Pt rotateZ(float z)

rotateX

public Pt rotateX(Param v)

rotateY

public Pt rotateY(Param v)

rotateZ

public Pt rotateZ(Param v)

scale

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

scale

public Pt scale(XYZ p)

scale

public Pt scale(Pt p)

scale

public Pt scale(float x)

scale

public Pt scale(float x,
                float y)

scale

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

scale

public Pt scale(Param x,
                Param y)

scale

public Pt scale(Param x)

scaleX

public Pt scaleX(float x)

scaleX

public Pt scaleX(Param x)

scaleY

public Pt scaleY(float y)

scaleY

public Pt scaleY(Param y)

scaleZ

public Pt scaleZ(float z)

scaleZ

public Pt scaleZ(Param z)

translate

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

translate

public Pt translate(XYZ p)

translate

public Pt translate(Pt p)

translate

public Pt translate(float x,
                    float y)

translate

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

translate

public Pt translate(Param x,
                    Param y)

translateX

public Pt translateX(float x)

translateX

public Pt translateX(Param x)

translateY

public Pt translateY(float y)

translateY

public Pt translateY(Param y)

translateZ

public Pt translateZ(float z)

translateZ

public Pt translateZ(Param z)

apply

public Pt apply(Transform t)

multiply

public PtDER multiply(float k,
                      float l,
                      float m)
Specified by:
multiply in interface iArithmetic

multiply

public PtDER multiply(float k,
                      float l)
Specified by:
multiply in interface iArithmetic

multiply

public PtDER multiply(float k)
Specified by:
multiply in interface iArithmetic

multiply

public PtDER multiply(XYZ p)
Specified by:
multiply in interface iArithmetic

multiply

public PtDER multiply(Pt p)

divide

public PtDER divide(float k,
                    float l,
                    float m)
Specified by:
divide in interface iArithmetic

divide

public PtDER divide(float k,
                    float l)
Specified by:
divide in interface iArithmetic

divide

public PtDER divide(float kk)
Specified by:
divide in interface iArithmetic

divide

public PtDER divide(XYZ p)
Specified by:
divide in interface iArithmetic

plus

public PtDER plus(XYZ p)
Specified by:
plus in interface iArithmetic

plus

public PtDER plus(Pt p)

plus

public PtDER plus(float k,
                  float l,
                  float m)
Specified by:
plus in interface iArithmetic

plus

public PtDER plus(float k,
                  float l)
Specified by:
plus in interface iArithmetic

plus

public PtDER plus(float k)
Specified by:
plus in interface iArithmetic

minus

public PtDER minus(XYZ p)
Specified by:
minus in interface iArithmetic

minus

public PtDER minus(Pt p)

minus

public PtDER minus(float k,
                   float l,
                   float m)
Specified by:
minus in interface iArithmetic

minus

public PtDER minus(float k,
                   float l)
Specified by:
minus in interface iArithmetic

minus

public PtDER minus(float k)
Specified by:
minus in interface iArithmetic

set

public void set(float x,
                float y,
                float z)
Specified by:
set in interface XYZ

set

public void set(float x,
                float y)
Specified by:
set in interface XYZ

set

public void set(float x)
Specified by:
set in interface XYZ

set

public void set(Param x,
                Param y,
                Param z)
Specified by:
set in interface XYZ

set

public void set(Param x,
                Param y)
Specified by:
set in interface XYZ

set

public void set(Param x)
Specified by:
set in interface XYZ

set

public void set(XYZ p)
Specified by:
set in interface XYZ

x

public void x(float x)
Specified by:
x in interface XYZ

x

public void x(Param x)
Specified by:
x in interface XYZ

y

public void y(float y)
Specified by:
y in interface XYZ

y

public void y(Param y)
Specified by:
y in interface XYZ

z

public void z(float z)
Specified by:
z in interface XYZ

z

public void z(Param z)
Specified by:
z in interface XYZ

set

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

setMeta

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

tag

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

tag

public Pt tag(Meta tag)

toString

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

plus

public java.lang.String plus(java.lang.String s)

toShortString

public java.lang.String toShortString()

toAutocad

public java.lang.String toAutocad()

toAutocadPart

public java.lang.String toAutocadPart()

toMegaPPOV

public java.lang.String toMegaPPOV()

toPovRay

public java.lang.String toPovRay()

toPovRayAsObject

public java.lang.String toPovRayAsObject()

toRadiance

public java.lang.String toRadiance()

toRadianceAsObject

public java.lang.String toRadianceAsObject()
Export a Pt to Radiance as a sphere Output example:
            material sphere name
                0
                0
                4       1454.1045       140.25954       0 25
 

Returns:
String of code (MultiLines)

toANSYS

public java.lang.String toANSYS()

toRhino

public java.lang.String toRhino()

toRhinoAsVar

public java.lang.String toRhinoAsVar()

toRhinoAsObject

public java.lang.String toRhinoAsObject()

toStringTab

public java.lang.String toStringTab()

toStringTabRad

public java.lang.String toStringTabRad()

toStringComa

public java.lang.String toStringComa()

toStringComaPovRay

public java.lang.String toStringComaPovRay()

toSketchUp

public java.lang.String toSketchUp()
Returns:

toSingleName

public java.lang.String toSingleName()
Returns:

toSketchUpAsPoint3D

public java.lang.String toSketchUpAsPoint3D()
Returns:

toObjExporter

public java.lang.String toObjExporter()
Returns:

toObjExporterAsObject

public java.lang.String toObjExporterAsObject()

create

public static Pt create(Vertex t)
Parameters:
t -
Returns:

length

public float length()
Specified by:
length in interface XYZ

lengthSq

public float lengthSq()
Specified by:
lengthSq in interface XYZ

length

public float length(XYZ p)
Specified by:
length in interface XYZ

lengthSq

public float lengthSq(XYZ p)
Specified by:
lengthSq in interface XYZ

length

public static float length(XYZ p,
                           XYZ q)

lengthNoSq

public static float lengthNoSq(XYZ p,
                               XYZ q)

dot

public static float dot(XYZ v0,
                        XYZ v1)

dot

public float dot(XYZ v)
Specified by:
dot in interface XYZ

equalsPt

public boolean equalsPt(XYZ v,
                        float clamping)

equalsPt

public boolean equalsPt(XYZ v)
Specified by:
equalsPt in interface XYZ

bound

public XYZ[] bound()
Returns:
An array containning the same point twice.

boundCenter

public XYZ boundCenter()
Returns:
the point in the middle of the smallest enclosing box. In this case, the point itself only.

copy

public Pt copy()
Returns: