Native Entities - HiStructClient/femcad-doc GitHub Wiki

List of native entities

  1. Point
  2. Vertex
  3. Vector
  4. Matrix 33
  5. Local coordinate system
  6. Curve
  7. Area
  8. Volume

Point 3D

p1 = Fcs.Geometry.Point3D(0, 0, 1)
  • point is intended to be used further (not on its own, as vertex for example)
# input of point using point, multiplier and vector
p2 = p1 * 1 * vv1

Vertex 3D

v1 = Fcs.Geometry.Vertex3D(0, 0, 0)

# or
v1 = Fcs.Geometry.Vertex3D(p1)

# or
vertex {v1} xyz 0 0 0

Only the third possibility above displays vertex graphically, the two above not (althought they are handeled in the same manner in further code.

Vector 3D

vv1 = Fcs.Geometry.Vector3D(1, 0, 0)

Matrix 33

myMatrix33 = Fcs.Geometry.Matrix33(vv1, vv2, vv3)

Local coordinate system

LCS by transformation matrix

lcs = Fcs.Geometry.Lcs(p1, myMatrix33)

# or
lcs {LCS1} origin {v1} matrix 0 0 0 0 0 0 0 0 0

Example of advanced syntax:

lcs = Fcs.Geometry.Lcs(
   Fcs.Geometry.Point3D(1,0,1),
   Fcs.Geometry.Matrix33( 
       Fcs.Geometry.Vector3D(1,0,0),
       GCS.Axes.Z, 
       GCS.Axes.Y
   )
)

LCS by translating coordinate system

lcsOne = GCS.Tx(1).Ty(2).Tz(3)

LCS by rotating coordinate system

lcsTwo = GCS.Rx(PI/2).Ry(PI).Rz(-PI/4)

LCS by two points

Creates Lcs with direction of X axis defined by two points:

lcsThree = FCS.Geometry.Tools.CreateDefaultLcsByTwoPoints( 
   Fcs.Geometry.Point3D( 0,  0,  0 ) ,   # origin point
   Fcs.Geometry.Point3D( Fx,  Fy,  Fz )  # point in X axis direction
)

Creates Lcs with two points and Z axis vector:

lcsFour = FCS.Geometry.Tools.CreateDefaultLcsByTwoPointsAndZ( 
   Fcs.Geometry.Point3D( 0,  0,  0 ), # origin point
   Fcs.Geometry.Point3D( 0,  1,  0 ), # point in X axis direction
   GCS.Axes.Z,                        # Z axis direction
)  

Curve

Line

curve {c1} vertex {v1} {v2}

Polyline

# polyline without roundings
curve {c1} filletedpoly radiusmultiplier 0 vertexes {a1} {a2} {a3} {a4} {a1} fillets 1 1 1 1 1

# polyline with rounding
curve {c1} filletedpoly radiusmultiplier 1 vertexes {a1} {a2} {a3} {a4} {a1} fillets r1 r2 r3 r4 r5

Alternative definition of curve using items array (with layer definition):

a = 1.00 
b = 1.03

layer {koko} color (Black)

vertex {v1} xyz -a/2 -b/2 0
vertex {v2} xyz  a/2 -b/2 0
vertex {v3} xyz  a/2  b/2 0
vertex {v4} xyz -a/2  b/2 0

itemsArray = [
   {Vertex = v1, Radius = 1 },
   {Vertex = v3, Radius = 1 },
   {Vertex = v4, Radius = 1 },
   {Vertex = v2, Radius = 1 },
   {Vertex = v1, Radius = 1 },
]

curve {c5} filletedpoly items (itemsArray) radiusmultiplier 0.1 layer (koko)

Area

area {a1} boundary curve {c1} mapping Auto
# or
area {a2} boundary curve +101 +102 +103+ 104 mapping Auto
# or area with opening
area {a3} boundary curve +1 +2 opening curve -3 -4 mapping Auto

Note: Surface of the area can be calculated using any of the following two functions:

surface = a1.GetArea()
# or
surface = a.MeasureArea()

Volume

volume 1 prism {a1} {a2}
⚠️ **GitHub.com Fallback** ⚠️