Table of Contents

Method GetSplines

Namespace
GeometryHelper.IfcConvert.Core
Assembly
GeometryHelper.IfcConvert.dll

GetSplines(string, IfcConvertOptions)

Retrieves the B-spline curves of a product by its GlobalId (GUID): each IfcBSplineCurveWithKnots, rational or not, among the items of its representations, as a GeoSpline3 with the file's degree, control points, knots and weights. Returns an empty list if the product is not found or has none.

public IReadOnlyList<GeoSpline3> GetSplines(string guid, IfcConvertOptions options = null)

Parameters

guid string

The GlobalId (GUID) of the product.

options IfcConvertOptions

Optional conversion options: the scale, the target unit, the coordinate space and the name filters apply as for solids.

Returns

IReadOnlyList<GeoSpline3>

A read-only list of the splines, in the order of the product's representations and their items.

Remarks

A curve is read from every representation of the product, the 'Axis' of a member above all: as an item itself, among the elements of an IfcGeometricSet or IfcGeometricCurveSet, as the parent curve of a segment of an IfcCompositeCurve, as the directrix of an IfcSweptDiskSolid, and in a mapped item, placed by the mapping as a solid is. A swept disk that runs along only a part of its directrix, from StartParam to EndParam, gives that part: the parameter of a B-spline curve is the value of its knots, so the part is the spline cut exactly at those knot values (the cubic over [0, 1] swept from 0.25 to 0.75 gives its middle half by the knots); a pair outside the domain, or not in order, gives the whole curve with a Warn. A curve met twice in one place in the same way, as an axis and as the directrix of a disk that runs along all of it, is read once. The file gives each distinct knot once with the number of times it is repeated; the spline has them repeated, so the cubic Bézier with the knots (0, 1) repeated (4, 4) has the knots 0, 0, 0, 0, 1, 1, 1, 1. The control points are scaled to the target unit and placed; the knots and weights are kept as the file gives them, and a mapping that scales unevenly is carried exactly, a NURBS being the NURBS of its carried control points.

GeometryHelper's splines are clamped, so a curve whose knots run on past its ends, a periodic one, is left out with a Warn, as is one whose numbers do not make a spline. An IfcIndexedPolyCurve holds no B-spline; a B-spline that is the basis of an IfcTrimmedCurve is only a part of itself there, and one in the outline of a profile lies in a frame of the solid it is swept into: neither is read. The IfcBezierCurve of IFC2X3 gives no knots, and is not read either. Every call writes one Info line; the items with no B-spline in them are counted in one Debug line.