load_dxf#

sectionproperties.pre.geometry.load_dxf(dxf_filepath: str | Path, spline_delta: float, degrees_per_segment: float) Geometry | CompoundGeometry[source]#

Import any-old-shape in .dxf format for analysis.

Parameters:
  • dxf_filepath (str | Path) – Path to .dxf file to load

  • spline_delta (float) – Splines are not supported in shapely, so they are approximated as polylines, this argument affects the spline sampling rate

  • degrees_per_segment (float) – The number of degrees discretised as a single line segment

Raises:
  • ImportError – If cad_to_shapely is not installed. To enable dxf features use pip install sectionproperties[dxf].

  • RuntimeError – No polygon objects are found in the file

  • ValueError – The filepath does not exist

Returns:

Geometry or CompoundGeometry loaded from .dxf file

Return type:

Geometry | CompoundGeometry