FCS Geometry Primitives

Geometry in FCS is defined using data item statements - special keywords that create geometric entities in the FemCAD model database.

General Syntax

keyword {identifier} type parameters...
keyword indexOrId parameters...

1. Vertex (Point)

Creates a 3D point in space.

Syntax

vertex {name} xyz X Y Z
vertex index xyz X Y Z

Examples

# Named vertices
vertex {origin} xyz 0 0 0
vertex {p1} xyz 10 0 0
vertex {p2} xyz 10 5 0
vertex {p3} xyz 0 5 0

# Vertices with expressions
height := 15
radius := 5
vertex {top} xyz 0 0 height
vertex {corner} xyz radius*Cos(PI/4) radius*Sin(PI/4) 0

# Numeric identifiers
vertex 1 xyz 0 0 0
vertex 2 xyz 1 0 0

# Referencing vertex coordinates
x_coord := p1.X
y_coord := p1.Y
z_coord := p1.Z

Using Point3D Constructor

# Alternative: create Point3D object
pt := Fcs.Geometry.Point3D(10, 20, 30)

# Then create vertex from point
vertex {v1} xyz pt.X pt.Y pt.Z

Vertex from Another Vertex

# Create vertex referencing another
vertex {v1} xyz 0 0 0
vertex {v2} xyz v1.X+10 v1.Y v1.Z

2. Curve (Line/Arc/Spline)

Creates 1D geometric entities connecting vertices.

Straight Line

curve {name} vertex {startVertex} {endVertex}

Arc (3-point)

curve {name} arc vertex {start} {mid} {end}

Polyline

curve {name} poly vertexes {v1} {v2} {v3} {v4}

Filleted Polyline

curve {name} filletedpoly vertexes {v1} {v2} {v3} {v4} fillets r1 r2 r3 r4
curve {name} filletedpoly radiusmultiplier factor vertexes {...} fillets f1 f2 ...

Examples

# Define vertices first
vertex {A} xyz 0 0 0
vertex {B} xyz 10 0 0
vertex {C} xyz 10 10 0
vertex {D} xyz 0 10 0
vertex {mid} xyz 5 12 0

# Straight line
curve {line1} vertex {A} {B}

# Arc through 3 points
curve {arc1} arc vertex {A} {mid} {C}

# Polyline (open)
curve {poly1} poly vertexes {A} {B} {C} {D}

# Closed polyline (return to start)
curve {boundary} poly vertexes {A} {B} {C} {D} {A}

# Filleted corners (r=0.5 at each corner)
curve {rounded} filletedpoly vertexes {A} {B} {C} {D} {A} fillets 0 0.5 0.5 0.5 0

Curve Properties

length := line1.Geometry.Length
# Access start/end points through Geometry property

3. Area (Surface)

Creates 2D surfaces bounded by curves.

From Boundary Curves

area {name} boundary curve {c1} {c2} {c3} {c4}
area index boundary curve {c1} {c2} {c3} ...

Examples

# Rectangular area from 4 lines
vertex {v1} xyz 0 0 0
vertex {v2} xyz 10 0 0
vertex {v3} xyz 10 5 0
vertex {v4} xyz 0 5 0

curve {c1} vertex {v1} {v2}
curve {c2} vertex {v2} {v3}
curve {c3} vertex {v3} {v4}
curve {c4} vertex {v4} {v1}

area {plate} boundary curve {c1} {c2} {c3} {c4}

# Or using numeric IDs
area 1 boundary curve {c1} {c2} {c3} {c4}

Triangular Area

vertex {t1} xyz 0 0 0
vertex {t2} xyz 5 0 0
vertex {t3} xyz 2.5 4 0

curve {e1} vertex {t1} {t2}
curve {e2} vertex {t2} {t3}
curve {e3} vertex {t3} {t1}

area {triangle} boundary curve {e1} {e2} {e3}

Area with Hole

# Outer boundary
curve {outer} poly vertexes {A} {B} {C} {D} {A}
# Inner hole boundary
curve {hole} poly vertexes {H1} {H2} {H3} {H4} {H1}

area {withHole} boundary curve {outer} hole curve {hole}

4. Volume (3D Solid)

Creates 3D volumes from bounding surfaces.

Syntax

volume {name} boundary area {a1} {a2} {a3} ...

Example

# Define 6 faces of a box
# (each face needs vertices, curves, areas defined)
# Then:
volume {box} boundary area {top} {bottom} {front} {back} {left} {right}

5. Layer

Groups geometry and members for organization.

Syntax

layer {name} parameters...

Example

layer {beamLayer} color "blue"
layer {shellLayer} color "red" visible True

Layers can also carry inline visual material properties. These affect area/solid face materials in WebGL/HiScene output and work without a separate .fcsdrs file:

layer {glass} color LightCyan material {
    SurfaceColor := {R := 0.78, G := 0.92, B := 1.0},
    Transparent := True,
    Opacity := 0.32,
    Roughness := 0.05,
    Metalness := 0.0,
    Side := "Front"
}

See 26-MATERIAL-VISUALIZATION.md for material presets and all supported properties.

6. GClass (Parametric Class)

Defines a reusable parametric component from an external file.

Syntax

gclass {ClassName} filename "path/to/definition.fcs"

Examples

# Define beam cross-section classes
gclass {IPE200} filename "css/IPE200.fcs"
gclass {HEA300} filename "css/HEA300.fcs"
gclass {RectBeam} filename "css/rectangle.fcs"

# Use the class
beam1css := IPE200{}
beam2css := RectBeam{ width = 0.3, height = 0.5 }

7. GBlock (Instance)

Creates an instance of a gclass with transformations.

Syntax

gblock {name} class {ClassName} transform ...

8. Distribution

Defines distributions along curves (for varying loads, sections, etc.).

Syntax

distribution {name} type parameters...

Example

distribution {linearDist} linear start 0 end 1 values 100 200

9. Traction

Defines surface tractions for shell elements.

Syntax

traction {name} parameters...

10. Local Coordinate Systems

Vertex LCS

vertexLCS {name} parameters...
lcs {name} parameters...

Curve LCS

curveLCS {name} parameters...

11. Coordinate Reference

Global Coordinate System

# Access global axes
xAxis := GCS.Axes.X
yAxis := GCS.Axes.Y  
zAxis := GCS.Axes.Z
origin := GCS.Origin

12. Built-in Geometry Functions

Point3D

pt := Fcs.Geometry.Point3D(x, y, z)
# Properties: pt.X, pt.Y, pt.Z

Vector3D

vec := Fcs.Geometry.Vector3D(dx, dy, dz)
# Properties: vec.X, vec.Y, vec.Z
# Methods: vec.Length, vec.Normalize()

Vertex3D (Different from data item)

v := Fcs.Geometry.Vertex3D(x, y, z)
v := Fcs.Geometry.Vertex3D(point3d)

Transformations

# Rotate vector around axis
rotated := Fcs.Geometry.Vector3D(x,y,z).RotateVectorAroundAxis(GCS.Axes.Z, angle)

13. Geometry Patterns

Parametric Rectangle

# Parameters
L := 10     # length
W := 5      # width

# Vertices
vertex {v1} xyz 0 0 0
vertex {v2} xyz L 0 0
vertex {v3} xyz L W 0
vertex {v4} xyz 0 W 0

# Curves
curve {c1} vertex {v1} {v2}
curve {c2} vertex {v2} {v3}
curve {c3} vertex {v3} {v4}
curve {c4} vertex {v4} {v1}

# Area
area {rect} boundary curve {c1} {c2} {c3} {c4}

Parametric Circle (Approximated)

n := 8      # number of segments
R := 5      # radius

# Create vertices around circle
# (Usually done with Select/Range)
s2 := Sqrt(2)/2

vertex {p1} xyz R 0 0
vertex {p2} xyz R*s2 R*s2 0
vertex {p3} xyz 0 R 0
vertex {p4} xyz -R*s2 R*s2 0
vertex {p5} xyz -R 0 0
vertex {p6} xyz -R*s2 -R*s2 0
vertex {p7} xyz 0 -R 0
vertex {p8} xyz R*s2 -R*s2 0

# Connect with arcs for smooth circle
vertex {mid12} xyz R*Cos(PI/8) R*Sin(PI/8) 0
curve {arc12} arc vertex {p1} {mid12} {p2}
# ... etc for all segments

Shell Surface from Curves

# Define meridional curves
curve {Cv1} arc vertex {Vb1} {Vm1} {Vt1}
curve {Cv2} arc vertex {Vb2} {Vm2} {Vt2}

# Define circumferential curves  
curve {Cb12} arc vertex {Vb1} {Vb12} {Vb2}
curve {Ct12} arc vertex {Vt1} {Vt12} {Vt2}

# Create patch
area 1 boundary curve {Cv1} {Ct12} {Cv2} {Cb12}