Skip to content
ForCADDocumentation
Browse guide contents ↓

Measure a patch in Fortran

Declare the result as real(rk) and call the binding for the rank of your initialized patch. All three integrate in the physical coordinates of the patch.

Patch Call Runnable example
Curve call curve%cmp_length(value) Line segment of length 2
Surface call surface%cmp_area(value) Square of area 4
Volume call volume%cmp_volume(value) Cube of volume 8

Check the patch's err%ok before using the result. If your coordinates are in millimeters, length is in mm, area in mm², and volume in mm³.

Run the volume example in a compiler shell from the ForCAD checkout.

fpm run --example cmp_volume --profile release

It prints approximately 8. The public API reference links to the optional integration arguments.

Studio equivalent. Measure a selected patch using Model → Measure.