carbonfly.geo module
Geometry data models and RhinoCommon helpers for carbonfly.
This module defines the core geometry container used by carbonfly’s case builder: - CFGeo: a single CFD region/surface entity (name + Brep + Boundary + refinement) - Refine: snappyHexMesh surface refinement levels (min_level, max_level)
Note
This module depends on the RhinoCommon API and can only be used
inside Rhino / Grasshopper. The Rhino module is provided by Rhino.
- class carbonfly.geo.CFGeo(name: str, brep: Rhino.Geometry.Brep, boundary: Boundary, refine: Refine)[source]
Bases:
objectA single CFD surface entity.
- name
Region/solid name written into STL and used in snappy regions{}.
- Type:
str
- brep
Normalized Brep geometry.
- Type:
Rhino.Geometry.Brep
- brep: Rhino.Geometry.Brep
- name: str
- class carbonfly.geo.Refine(min_level: int = 0, max_level: int = 0)[source]
Bases:
objectSurface refinement levels for snappyHexMesh: (min, max).
- max_level: int = 0
- min_level: int = 0
- carbonfly.geo.make_cfgeo(name: str, geometry, boundary: Boundary, refine_levels: Any | None = None) CFGeo[source]
Create a CFGeo from Rhino geometry and bind the region name to the Boundary.
- Parameters:
name (str) – Region/solid name.
geometry – Rhino Surface/BrepFace/Brep.
boundary (Boundary) – Boundary specification.
refine_levels (Any, optional) – Refinement levels (see _norm_refine).
- Returns:
Constructed CFGeo object.
- Return type:
- Raises:
ValueError – If name/boundary/geometry is invalid.