<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Broken Mesh with TessellatedShapeBuilder in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722497#M52979</link>
    <description>&lt;P&gt;I was able to export simpler meshes (spheres and cubes) and they work just fine. So that eliminates the face normal issue. Its only happening with complex shapes.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2018 11:04:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-25T11:04:58Z</dc:date>
    <item>
      <title>Broken Mesh with TessellatedShapeBuilder</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722380#M52976</link>
      <description>&lt;P&gt;I am trying to create a mesh in Revit using TessellatedShapeBuilder, with the mesh data coming in from a different data model. I am creating faces and adding the faces to the shapebuilder. Please see the code attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/454596i50D10122B18D73E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the end I add the mesh to the document using DirectShape. And the resulting mesh looks as shown in the picture. Why is the mesh all broken ? The source mesh is normal looking.. looks like a spaceship, but this one is broken. I thought maybe it has&amp;nbsp;something to do with face normals ? Or is there some behavior of tessellatedshapebuilder that I am missing ? What am I doing wrong ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.PNG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/454597i348E2D2A007C0E65/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.PNG" alt="2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 10:16:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722380#M52976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-25T10:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Broken Mesh with TessellatedShapeBuilder</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722405#M52977</link>
      <description>&lt;P&gt;I guess there are a lot of things you might be doing wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No idea what they may be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cannot read your code from an image.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a list of some issues I addressed and solved creating direct shape elements from quite complex OBJ source files:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2015/02/from-hack-to-app-obj-mesh-import-to-directshape.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2015/02/from-hack-to-app-obj-mesh-import-to-directshape.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 10:29:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722405#M52977</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-01-25T10:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Broken Mesh with TessellatedShapeBuilder</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722456#M52978</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the source code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;(ppm) =&amp;gt; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; rg.TessellatedShapeBuilder builder = new rg.TessellatedShapeBuilder();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; builder.OpenConnectedFaceSet(true);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; builder.Target = rg.TessellatedShapeBuilderTarget.Mesh;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; builder.Fallback = rg.TessellatedShapeBuilderFallback.Salvage;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; List&amp;lt;rg.XYZ&amp;gt; allVerts = ppm.Vertices.Select((pt) =&amp;gt; ptConv.FromPipe&amp;lt;rg.XYZ, ppg.Vec&amp;gt;(pt)).ToList();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; foreach (var face in ppm.Faces)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp; List&amp;lt;rg.XYZ&amp;gt; faceVerts = new List&amp;lt;rg.XYZ&amp;gt;();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp; foreach(ulong vertIndex in face)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp; {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; faceVerts.Add(allVerts[(int)vertIndex]);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp; }&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp; rg.TessellatedFace tface = new rg.TessellatedFace(faceVerts, rg.ElementId.InvalidElementId);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp; //if (!builder.DoesFaceHaveEnoughLoopsAndVertices(tface)) { continue; }&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp; builder.AddFace(tface);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; builder.CloseConnectedFaceSet();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; builder.Build();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; rg.TessellatedShapeBuilderResult result = builder.GetBuildResult();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; List&amp;lt;rg.GeometryObject&amp;gt; geoms = result.GetGeometricalObjects().ToList();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp; return (rg.Mesh)geoms.FirstOrDefault();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;I saw that article before and the airplane seems to be the closest match, which is caused by smoothing groups, but I don't have any smoothing groups.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;Is there any other way to debug this and find out what exactly is going wrong with DirectShape ?!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;Thanks !&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 10:48:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722456#M52978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-25T10:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Broken Mesh with TessellatedShapeBuilder</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722497#M52979</link>
      <description>&lt;P&gt;I was able to export simpler meshes (spheres and cubes) and they work just fine. So that eliminates the face normal issue. Its only happening with complex shapes.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 11:04:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/broken-mesh-with-tessellatedshapebuilder/m-p/7722497#M52979</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-25T11:04:58Z</dc:date>
    </item>
  </channel>
</rss>

