GeometryGym / GeometryGymIFC

C# classes to generate and parse OpenBIM IFC files
Other
269 stars 97 forks source link

About IEnumerable<IEnumerable<IfcCartesianPoint>> #81

Closed BIMAutoDam closed 1 year ago

BIMAutoDam commented 1 year ago

When initialize the IfcBSplineSurface, how can the 'IEnumerable<IEnumerable>' be initialzed

jmirtsch commented 1 year ago

Something like this can create a b spline surface (I didn't validate the values are legitimate).

List<List<IfcCartesianPoint>> controlPoints = new List<List<IfcCartesianPoint>>(); List<IfcCartesianPoint> points = new List<IfcCartesianPoint>(); points.Add(new IfcCartesianPoint(db, 0, 0, 0)); points.Add(new IfcCartesianPoint(db, 1, 0, 0)); controlPoints.Add(points); points = new List<IfcCartesianPoint>(); points.Add(new IfcCartesianPoint(db, 0, 1, 0)); points.Add(new IfcCartesianPoint(db, 1, 1, 0)); controlPoints.Add(points);

List<int> uMults = new List<int>() { 1, 1 }, vMults = new List<int>() { 1, 1 }; List<double> uKnots = new List<double>() { 0, 1 }, vKnots = new List<double>() { 0, 1 };

IfcBSplineSurfaceWithKnots surfaceWithKnots = new IfcBSplineSurfaceWithKnots(1, 1, controlPoints, uMults, vMults, uKnots, vKnots, IfcKnotType.UNIFORM_KNOTS);

BIMAutoDam commented 1 year ago

Thanks, jmirtsch