Skip to content
ForCADDocumentation
Browse guide contents ↓

Fortran API

To use ForCAD in your own fpm project, start with Evaluate your first NURBS curve. The same project can run the complete programs in these guides. To try the examples distributed with ForCAD, build the library and run the bundled curve example.

Construct geometry

Starting point Operation
Known dimensions Construct a built-in curve, surface or volume
A smooth closed loop Construct a periodic curve and check its seam
An existing profile Extrude in a direction, revolve about an axis or sweep along a path
Ordered profiles Loft through sections
Measured positions Fit a curve to points, a surface to a grid or a volume to a 3D grid

Inspect geometry

Known quantity Find
Surface parameters A point and its tangents or rational basis values
Physical coordinates The nearest surface point or parameters inside a volume
A curve, surface or volume Length, area or volume

Edit a patch

Goal Operation
Move geometry Transform the entire patch
Change its shape Move a control point, change a weight or deform the control net with a NURBS lattice
Change knot spans Insert a knot, remove a knot or subdivide spans
Change degree Elevate the degree or reduce it within a tolerance
Change parameter coordinates Set interval bounds or reverse direction
Extract geometry Take a face or section, keep a parameter interval or extract a Bézier element
Divide geometry Split a patch in two
Recover from a failed edit Read the diagnostic and retry

Connect, mesh and export

Goal Operation
Connect patches Join two volumes and identify their shared controls
Generate a structured mesh Get nodes and hex cells from one volume or size matching grids across a patch interface
Reuse an existing mesh Map its nodes into a NURBS volume
Write a geometry file Export sampled geometry to VTK or export an exact curve to IGES

Integrate and differentiate

Goal Operation
Assemble an IGA problem Find the active controls on a knot span, integrate a surface field and solve a Poisson system
Differentiate a single patch Compute length sensitivity to a control or weight
Differentiate connected patches Vary a shared curve control or a control or weight on a shared volume face

See the public API reference for argument types, array shapes and optional arguments, or find the matching Studio operation.