private void Initialize(IfcStore model) { units = new UnitAssignmentRelation(model); material = new Material(model, "S235J0"); //creating main project axis CartesianPoint3D point = new CartesianPoint3D(model, 0, 0, 0); DirectionVector3D mainAxis = new DirectionVector3D(model, 0, 0, 1); DirectionVector3D refAxis = new DirectionVector3D(model, 1, 0, 0); projectAxis = new PlacementAxis3D(model, point, mainAxis, refAxis); context = new GeometricRepresentationContext(model, "Model", 3, 0.00001, projectAxis); subContext = new GeometricRepresentationSubContext(model, "Body", "Model", Xbim.Ifc2x3.RepresentationResource.IfcGeometricProjectionEnum.MODEL_VIEW, context); //creating project project = new Project(model, "RevitProject", context, units); //creating site sitePlacement = new LocalPlacement(model, null, projectAxis); site = new Site(model, "Site", sitePlacement, IfcElementCompositionEnum.ELEMENT, 0); PostalAddress post = new PostalAddress(model, "IN YOUR MOMMA ROOM"); buildingPlacement = new LocalPlacement(model, sitePlacement, projectAxis); building = new Building(model, "Building", buildingPlacement, IfcElementCompositionEnum.ELEMENT, post); stories = new List <BuildingStorey>(); InitializeRelations(); }
public RectangularCrossSection(ModelOptions modelOption, double x, double y, double depth) { //Position of the 2D rectangular section (Will remain fixed). CartesianPoint2D p = CartesianPoint2D.Origin(modelOption.Model); DirectionVector2D v = DirectionVector2D.UnitX(modelOption.Model); PlacementAxis2D postion = new PlacementAxis2D(modelOption.Model, p, v); RectangleProfile rectProfile = new RectangleProfile(modelOption.Model, x, y, Xbim.Ifc2x3.ProfileResource.IfcProfileTypeEnum.AREA, postion); //Local placement of the 3D definition shape of the column(Will remain fixed). CartesianPoint3D Expoint = CartesianPoint3D.Origin(modelOption.Model); DirectionVector3D exMain = DirectionVector3D.UnitZ(modelOption.Model); DirectionVector3D exReff = DirectionVector3D.UnitX(modelOption.Model); PlacementAxis3D Exaxis = new PlacementAxis3D(modelOption.Model, Expoint, exMain, exReff); DirectionVector3D extVec = DirectionVector3D.UnitZ(modelOption.Model); ExtrudedAreaSolid solid = new ExtrudedAreaSolid(modelOption.Model, depth, rectProfile, extVec, Exaxis); ShapeRepresentation representation = new ShapeRepresentation(modelOption.Model, modelOption.Environment.SubContext, new List <ExtrudedAreaSolid>() { solid }); ProductShape = new ProductionDefinitionShape(modelOption.Model, new List <ShapeRepresentation>() { representation }); //Local placement of the object placement of the column (This will be manipulated according to Autodesk Revit readings). CartesianPoint3D point = CartesianPoint3D.Origin(modelOption.Model); DirectionVector3D main = DirectionVector3D.UnitZ(modelOption.Model); DirectionVector3D reff = DirectionVector3D.UnitX(modelOption.Model); PlacementAxis3D axis = new PlacementAxis3D(modelOption.Model, point, main, reff); LocalPlacement placement = new LocalPlacement(modelOption.Model, modelOption.Environment.Stories.FirstOrDefault().LocalPlacement, axis); }
public static double Distance3D(Coord pointA, Coord pointB) { var g1 = new CartesianPoint3D(pointA.Latitude, pointA.Longitude); var g2 = new CartesianPoint3D(pointB.Latitude, pointB.Longitude); return(Distance3D(g1, g2)); }
private static double Distance3D(CartesianPoint3D g1, CartesianPoint3D g2) { double dX = g1.X - g2.X; double dY = g1.Y - g2.Y; double dZ = g1.Z - g2.Z; double r = Math.Sqrt(dX * dX + dY * dY + dZ * dZ); return(Constants.Earth_Diameter_In_Meters * Math.Asin(r)); }
public TeklaPlatePlacementInitializer(IfcStore model, Model_info.Environment env, Point origin, Vector main, Vector reff) { this.origin = new CartesianPoint3D(model, origin.X, origin.Y, origin.Z); this.main = new DirectionVector3D(model, main.X, main.Y, main.Z); this.reff = new DirectionVector3D(model, reff.X, reff.Y, reff.Z); PlacementAxis3D axis = new PlacementAxis3D(model, this.origin, this.main, this.reff); localPlacement = new LocalPlacement(model, env.Stories.FirstOrDefault().LocalPlacement, axis); }