private void Stream(ArrayList data, CylindricalFace face) { data.Add(new Snoop.Data.ClassSeparator(typeof(CylindricalFace))); data.Add(new Snoop.Data.Xyz("Origin", face.Origin)); data.Add(new Snoop.Data.Xyz("Axis", face.Axis)); }
public static bool IsVertical(CylindricalFace f) { return(Util.IsVertical(f.Axis)); }
Stream(CylindricalFace face) { StreamFaceGeoometry(face); }
private void DataProcess(Solid geomSolid, GeometryInstance instance) { try { uint ufaces = 0; uint uVertices = 0; uint uPoints = 0; uint iStartId = (uint)d_VerticesList.Count; foreach (Face geomFace in geomSolid.Faces) { iStartId = (uint)d_VerticesList.Count; bool bNewFace = true; ufaces++; Mesh mesh = geomFace.Triangulate(); foreach (XYZ ii in mesh.Vertices) { uVertices++; XYZ point = ii; if (null != instance) { Transform instTransform = instance.Transform; XYZ transformedPoint = instTransform.OfPoint(point); } } uint iNextId = 0; for (int i = 0; i < mesh.NumTriangles; i++) { MeshTriangle triangle = mesh.get_Triangle(i); XYZ vertex = triangle.get_Vertex(0); if (bNewFace) { iNextId = iStartId / 3; bNewFace = false; } u_IndicesList.Add(3); AddVertex(iStartId, vertex, iNextId++); vertex = triangle.get_Vertex(1); AddVertex(iStartId, vertex, iNextId++); vertex = triangle.get_Vertex(2); AddVertex(iStartId, vertex, iNextId++); } XYZ origin = new XYZ(0, 0, 0); XYZ normal = new XYZ(0, 0, 0); XYZ vector = new XYZ(0, 0, 0); PlanarFace planarFace = geomFace as PlanarFace; if (null != planarFace) { origin = planarFace.Origin; normal = planarFace.Normal; vector = planarFace.get_Vector(0); } ConicalFace ConFace = geomFace as ConicalFace; if (null != ConFace) { origin = ConFace.Origin; normal = ConFace.Axis; vector = ConFace.get_Radius(0); } HermiteFace HermiteFace = geomFace as HermiteFace; if (null != HermiteFace) { origin = new XYZ(0, 0, 0); //HermiteFace.Points; normal = new XYZ(0, 0, 0); //HermiteFace.TaAxis; vector = new XYZ(0, 0, 0); //HermiteFace.get_Tangents(0); } RevolvedFace RevolFace = geomFace as RevolvedFace; if (null != RevolFace) { origin = RevolFace.Origin; normal = RevolFace.Axis; vector = RevolFace.get_Radius(0); } RuledFace RulFace = geomFace as RuledFace; if (null != RulFace) { origin = new XYZ(0, 0, 0); // RulFace.get_Point; normal = new XYZ(0, 0, 0); ///RulFace.Axis; vector = RulFace.get_Point(0); } CylindricalFace CylinFace = geomFace as CylindricalFace; if (null != CylinFace) { origin = CylinFace.Origin; normal = CylinFace.Axis; vector = CylinFace.get_Radius(0); } uint featuresCount = 0; for (int s = d_NormalsList.Count; s < d_VerticesList.Count; s += 3) { d_NormalsList.Add(normal.X); d_NormalsList.Add(normal.Y); d_NormalsList.Add(normal.Z); d_TextureCoordsList.Add(normal.X); d_TextureCoordsList.Add(normal.Y); d_TextureCoordsList.Add(normal.Z); featuresCount++; } u_FeaturesIndList.Add(featuresCount); } foreach (Edge edge in geomSolid.Edges) { foreach (XYZ ii in edge.Tessellate()) { uPoints++; XYZ point = ii; if (null != instance) { Transform instTransform = instance.Transform; XYZ transformedPoint = instTransform.OfPoint(point); } } }//foreach (Face geomFace in geomSolid.Faces) //string Osa = element.Name.ToString() + element.Id.ToString(); } catch (Exception e) { string message; // Exception rised, report it by revit error reporting mechanism. message = e.ToString(); File.AppendAllText(@"C:\CadFaster\Revit\ExeWriter_log.txt", message); //return Autodesk.Revit.UI.Result.Failed; } //End of DataProcess }
public virtual void Stream(CylindricalFace face) { StreamFaceGeoometry(face); }
public Surface FaceToSpeckle(CylindricalFace cylindricalFace, double tolerance) { throw new NotImplementedException(); }
public virtual void Stream(CylindricalFace face) { StreamFaceGeometry(face); }