Skip to content

what's wrong in my code to Create a PolygonalFaceSet Geometry? #106

@Huzhengyang93

Description

@Huzhengyang93

`DatabaseIfc db = new DatabaseIfc(ModelView.Ifc4X3NotAssigned);
IfcProject project = new IfcProject(db, "IfcPolygonalFaceSet Example");

IfcObjectPlacement objectplacement = new IfcLocalPlacement(new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0)));
var coordinates = new List<Tuple<double, double, double>>
{
new Tuple<double,double,double> ( 0, 0, 0 ),
new Tuple<double,double,double> (10, 0, 0),
new Tuple<double,double,double> (10, 0, 3),
new Tuple<double,double,double> (0, 0, 3),
new Tuple<double,double,double> (2.5, 4, 1.5)
};

var pointList = new IfcCartesianPointList3D(db, coordinates);

var faces = new List<Tuple<int, int, int>>
{
new Tuple< int, int, int >( 0, 1, 4 ),
new Tuple< int, int, int > (1, 2, 4),
new Tuple< int, int, int > (2, 3, 4),
new Tuple< int, int, int > (3, 0, 4),
new Tuple< int, int, int > (0, 3, 2),
new Tuple< int, int, int > (2, 1, 0)
};

List facelist = new List();
foreach (var item in faces)
{
IfcIndexedPolygonalFace face = new IfcIndexedPolygonalFace(db, item.Item1, item.Item2, item.Item3);
facelist.Add(face);
}
IfcPolygonalFaceSet polygonalIT = new IfcPolygonalFaceSet(pointList, facelist);
IfcShapeRepresentation shapeRepresentation1 = new IfcShapeRepresentation(polygonalIT);
IfcProductDefinitionShape shape1 = new IfcProductDefinitionShape(shapeRepresentation1);
var geo = new IfcGeomodel(project, objectplacement, shape1);

db.WriteFile(filefullname);`

by this code I want to create a pyramid Geometry,but got a plane

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions