Пример #1
0
        /// <summary>
        /// Collect all triangles from the solid
        /// of the given element.
        /// </summary>
        public TriangleCollector(Element e)
        {
            FamilyInstance fi = e as FamilyInstance;

            _uses_instance_geometry = (null == fi)
        ? false
        : Autodesk.Revit.DB.IFC.ExporterIFCUtils
                                      .UsesInstanceGeometry(fi);

            _vertices          = new IntVertexLookup();
            _instance_meshes   = new List <JtFace>();
            _instance_solids   = new List <JtSolid>();
            _symbol_meshes     = new List <JtFace>();
            _symbol_solids     = new List <JtSolid>();
            _symbol_transform  = null;
            _transformations   = null;
            _max_nesting_level = 0;

            DrawElement(e);

            Debug.Assert((0 == _max_nesting_level) ^ (null != fi),
                         "expected zero symbol nesting for non-family-instance");

            Debug.Assert(!_uses_instance_geometry == HasSymbol,
                         "expected instance using symbol geo to have a symbol");
        }
Пример #2
0
 /// <summary>
 /// Return a JSON string representing
 /// the list of faces
 /// </summary>
 public string ToJson(
     IntVertexLookup vertices)
 {
     return(string.Format(
                "[ {0} ]",
                string.Join(", ",
                            this.Select <JtFace, string>(f
                                                         => f.ToJson(vertices)))));
 }
Пример #3
0
 /// <summary>
 /// Return a JSON string representing
 /// the list of face triangles
 /// </summary>
 public string ToJson(
     IntVertexLookup vertices)
 {
     return(string.Format(
                "[ {0} ]",
                string.Join(", ",
                            this.Select <JtTriangle, string>(t
                                                             => t.ToJsonCoords(vertices)))));
 }
Пример #4
0
 /// <summary>
 /// Return a JSON string with the comma-separated
 /// coordinates of the three triangle vertices
 /// </summary>
 public string ToJsonCoords(
     IntVertexLookup vertices)
 {
     return(string.Format(
                "[ {0}, {1}, {2} ]",
                vertices[A].ToJsonCoords(),
                vertices[B].ToJsonCoords(),
                vertices[C].ToJsonCoords()));
 }
Пример #5
0
 public TriangleCollector()
 {
   _vertices = new IntVertexLookup();
   _lines = new List<LineSegmentIndices>();
   _instance_triangles = new List<TriangleIndices>();
   _symbol_transform = null;
   _symbol_triangles = new List<TriangleIndices>();
   _transformations = null;
 }
 /// <summary>
 /// Collect all triangles from the solid
 /// of the given element.
 /// </summary>
 public TriangleCollector( Element e )
 {
   _vertices = new IntVertexLookup();
   _lines = new List<LineSegmentIndices>();
   _instance_triangles = new List<TriangleIndices>();
   _symbol_transform = null;
   _symbol_triangles = new List<TriangleIndices>();
   _transformations = null;
   _max_nesting_level = 0;
   DrawElement( e );
 }