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: object

A 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

boundary

Boundary description bound to this region.

Type:

Boundary

refine

Surface refinement levels (min_level, max_level).

Type:

Refine

boundary: Boundary
brep: Rhino.Geometry.Brep
name: str
refine: Refine
class carbonfly.geo.Refine(min_level: int = 0, max_level: int = 0)[source]

Bases: object

Surface 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:

CFGeo

Raises:

ValueError – If name/boundary/geometry is invalid.