Skip to content

pyflightstream.workspace.prop_slice (provisional)

Generated from the docstrings at build time: every one of the 3 names in the __all__ of pyflightstream.workspace.prop_slice has an entry below. The names a guide or an example uses come first; the others follow under Advanced.

Slice a propeller OBJ or IGES into blade sections and the propeller definition.

Pipeline role: the workspace layer's reader and writer around the pure slicer :mod:pyflightstream.geometry._propeller_slice. An OBJ is read as its polygons; an IGES is imported by the gmsh kernel in a worker process of its own, triangulated finely and every section point is projected back onto its exact face. The folder written holds the propeller definition propeller.toml that rebuilds the propeller, one normalized profile per station under sections/, the table table.csv and the record prop-slice.json (docs/propeller.md, "Slicing an existing propeller").

Advanced

pyflightstream.workspace.prop_slice.OBJ_UNITS module-attribute

OBJ_UNITS = {"mm": 1.0, "cm": 10.0, "m": 1000.0, "in": 25.4}

pyflightstream.workspace.prop_slice.TABLE_COLUMNS module-attribute

TABLE_COLUMNS = (
    "r_R",
    "c_R",
    "beta_deg",
    "t_c",
    "camber",
    "te_gap_c",
    "skew_deg",
    "rake_x_R",
    "airfoil",
)

pyflightstream.workspace.prop_slice.slice_propeller

slice_propeller(
    geometry: str | Path,
    *,
    blades: int,
    out: str | Path,
    axis: Sequence[float] | None = None,
    origin: Sequence[float] | None = None,
    blade_dir: Sequence[float] | None = None,
    stations: Sequence[float] | None = None,
    unit: str = "mm",
    overwrite: bool = False,
) -> dict[str, Any]

Cut one blade of a propeller at radial stations and write its propeller definition.

Parameters:

Name Type Description Default
geometry str or Path

The propeller, an OBJ (.obj) or an IGES (.igs, .iges); read only.

required
blades int

The number of blades; the blades found about the axis must match it.

required
out str or Path

The folder to write: propeller.toml, sections/sNN.dat, table.csv and prop-slice.json.

required
axis sequence of float

The thrust direction, the builder's frame.thrust_dir; default (-1, 0, 0).

None
origin sequence of float

A point of the shaft in mm, the builder's frame.pitch_axis_point_mm; default 0.

None
blade_dir sequence of float

The reference blade direction, the builder's frame.blade_dir; default (0, 0, 1). Blade 0 is the blade nearest it, and skew is measured from it.

None
stations sequence of float

r/R of the sections, at least four, increasing, up to 1; default 21 equal steps from the blade root to the tip, and 0.7.

None
unit str

The length unit of an OBJ: mm (default), cm, m or in, or the words MILLIMETER, CENTIMETER, METER and INCH, in any case; the record keeps the short name. An IGES states its own unit.

'mm'
overwrite bool

Replace propeller.toml, table.csv, prop-slice.json and sections/ when out already holds any of them; without it they are refused.

False

Returns:

Type Description
dict

The record written to prop-slice.json: the inputs, the measured radius, root, rotation and blade count, the files, and the table without the profile points.

Raises:

Type Description
InputArtifactError

The file is missing, its suffix is not .obj, .igs or .iges, no blade is found, or out already holds an output and overwrite is not given.

InputValueError

The blade count is not a positive integer or does not match the blades found, or a station or a direction is invalid.

MissingExtraError

An IGES is given and the gmsh library cannot load.