Studio and Fortran equivalents
Find a Studio command and a worked example using the public ForCAD API. A curve has one parameter direction. On a surface, U and V correspond to dir=1 and dir=2. A volume adds W at dir=3.
Evaluate a patch
| ForCAD Studio | Public Fortran API |
|---|---|
| Inspector → Selection and probe · surface position and tangents | Evaluate cmp_Xg at a parameter pair. The optional derivative orders select the U or V tangent. |
| Patch → Parameter panels · basis plot | Evaluate a curve’s rational basis with basis. |
| Snap → Snap to closest point · while dragging a control point | Project a physical point onto a surface with nearest_point2. For a solid, Studio snaps to an exterior face. A Fortran volume query also searches its interior. |
Construct geometry
| ForCAD Studio | Public Fortran API |
|---|---|
| Create → Box | Create a volume with set_hexahedron(L, nc). Sample the box into hexahedra. |
| Create → Extrude | extrude constructs a surface from a curve or a volume from a surface. Run a volume extrusion. |
| Create → Revolve | revolve revolves a profile about an axis. Build a quarter-cylinder wall. |
| Create → Sweep | sweep translates a profile along a path. Sweep a tilted line along a circle. |
| Create → Loft | loft builds geometry through ordered sections. Loft between two circles. |
| Model → Deform | Fit and edit a NURBS control lattice with nurbs_control_lattice%fit and %evaluate, then update the patch with modify_Xc. |
| Model → Move, Rotate, Scale | Apply a matrix and translation with transform. |
Edit a patch
| ForCAD Studio | Public Fortran API |
|---|---|
| Patch → Points + weights · Move a control point | modify_Xc replaces one coordinate by control index and physical direction, or accepts the whole control array. Move the Z coordinate of a volume corner. |
| Patch → Points + weights · Change a weight | call curve%modify_Wc(W=2.0_rk, num=3). Run the same edit in Fortran. |
| Patch → Insert knot · Set value and copies | call curve%insert_knots(Xth=[0.5_rk], r=[1]). Check the midpoint after insertion. |
| Patch → Remove knot | Read the accepted count from remove_knots when only one copy can be removed. |
| Patch → Elevate degree | Raise the U degree of an annulus with elevate_degree. |
| Patch → Reduce degree | Read the accepted reduction and error bound from reduce_degree. |
| Patch → Refine patch | Subdivide each knot span with insert_knots. For a degree increase in the same edit, call elevate_degree first. |
| Patch → Set domain | Map a volume's U interval to new bounds with reparameterize. |
| Patch → Split patch · Divide a patch | call curve%split(u, lower, upper) produces two patches. Surface and volume splits also take a parameter direction. Check both halves of a unit cube. |
| Patch → Extract range | Restrict a patch to an interval and retain its geometry over that interval. |
| Patch → Extract face or Extract section | Use slice on a volume to obtain a surface at a boundary or interior parameter. |
| Patch → Reverse direction | Reverse a parameter direction while preserving the physical patch. |
| Model → Measure · Measure the selection | cmp_length, cmp_area, or cmp_volume integrates a patch of the corresponding rank. Measurement examples. |
Join and mesh patches
| ForCAD Studio | Public Fortran API |
|---|---|
| Multipatch → New multipatch | For a volume assembly, use nurbs_multipatch_volume. Register two members and connect their U faces. |
| Multipatch → Check interfaces | The assembly's is_valid checks the registered connections. |
| Multipatch → Insert knot or Elevate degree | Studio follows the mapped interface directions and applies insert_knots or elevate_degree to the affected members. |
| Mesh → Generate mesh · one patch | create samples the patch. get_Xg returns nodes and get_elem_Xg_vis returns cell connectivity. Generate 24 hex cells in Fortran. |
| Mesh → Generate mesh · conforming volume assembly | Sample the assembly with create using per-patch counts or a target size. Joined directions can share their sampling. Studio then assigns common node IDs on shared faces. Export the complete reconstruction. |
Exchange and project operations
A dash indicates a Studio operation with no direct public ForCAD call.
| ForCAD Studio | Public Fortran API |
|---|---|
| Project → Export IGES · curve or surface | Write a circle with export_iges. |
| Project → Export VTK · sampled patch geometry | Write a single sampled patch with create and export_Xg. |
| Mesh → Export mesh (VTK) · generated mesh | — |
| Project → Save · editable FCAD project | — |
| Project → Export Fortran · generate a standalone program | — |
| Undo a project edit | — |