<?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: AddFrom3DFaces creates additional area in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673398#M5171</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6785245"&gt;@WebberHu&lt;/a&gt;&amp;nbsp;, seems like a hack to me. Are you sure it works 100% of the time?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2023 03:27:42 GMT</pubDate>
    <dc:creator>soonhui</dc:creator>
    <dc:date>2023-01-12T03:27:42Z</dc:date>
    <item>
      <title>AddFrom3DFaces creates additional area</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11303240#M5167</link>
      <description>&lt;P&gt;Not sure whether this is related to &lt;A href="https://forums.autodesk.com/t5/civil-3d-customization/add-from-3dfaces/m-p/4654993" target="_blank" rel="noopener"&gt;this one&lt;/A&gt;, but I found that AddFrom3DFaces will create additional (unwanted) area, when you are dealing with concave faces. Here's the code to reproduce the problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;     public void FromMesh()
        {
            try
            {
                using (var ts = ActiveACADDocument.TransactionManager.StartOpenCloseTransaction())
                {
                    
                    var surfaceId2 = TinSurface.Create(ActiveACADDocument.Database, "FromMeshTest");
                    var platformSurface = ts.GetObject(surfaceId2, OpenMode.ForWrite) as TinSurface;

                    var bt = (BlockTable)ts.GetObject(ActiveACADDocument.Database.BlockTableId, OpenMode.ForRead, false);
                    var btr = (BlockTableRecord)ts.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
                   
                    var vertices = platformSurface.Vertices;
                    if (vertices.Count != 0)
                    {
                        platformSurface.DeleteVertices(vertices);
                    }
                    var faces = new ObjectIdCollection();

                    var vertex1 = new Point3d(0, 0, 0);
                    var vertex2 = new Point3d(10, 0, 0);
                    var vertex3 = new Point3d(10, 10, 0);
                    var vertex4 = new Point3d(0, 10, 0);
                    var polyMesh1 = new Face(vertex1, vertex2, vertex3, vertex4, true, true, true, true);
                    polyMesh1.SetDatabaseDefaults();
                    btr.AppendEntity(polyMesh1);
                    ts.AddNewlyCreatedDBObject(polyMesh1, true);
                    faces.Add(polyMesh1.ObjectId);

                    var vertex5 = new Point3d(5,10,0);
                    var vertex6 = new Point3d(10,10,0);
                    var vertex7 = new Point3d(10, 20, 0);
                    var vertex8 = new Point3d(5, 20, 0);
                    var polyMesh2 = new Face(vertex5, vertex6, vertex7, vertex8, true, true, true, true);
                    polyMesh2.SetDatabaseDefaults();
                    btr.AppendEntity(polyMesh2);
                    ts.AddNewlyCreatedDBObject(polyMesh2, true);
                    faces.Add(polyMesh2.ObjectId);



                    platformSurface.DrawingObjectsDefinition.AddFrom3DFaces(faces, true, $"Normal Platform");
                    platformSurface.Rebuild();
                    ACADEditor.ZoomExtents();
                    ts.Commit();
                }
            }
            catch (System.Exception e)
            {
                MessageBox.Show(e.ToString());
            }

        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The correct area for this TINSurface should be 150 sq. meter, but Civil 3D gives 175 sq. meter!&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="surface area not maintaqin.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1092682i0A31743FA3E1446A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="surface area not maintaqin.png" alt="surface area not maintaqin.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;How to properly add my faces to Surface, so that the topology is preserved?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the cousin method, AddFromPolyFaces, &lt;A href="https://forums.autodesk.com/t5/civil-3d-customization/system-argumentexception-value-does-not-fall-within-the-expected/m-p/11300143" target="_blank" rel="noopener"&gt;doesn't seem to work&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 06:59:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11303240#M5167</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2022-07-18T06:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: AddFrom3DFaces creates additional area</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11304682#M5168</link>
      <description>&lt;P&gt;Perhaps add a boundary for the perimeter?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 18:03:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11304682#M5168</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2022-07-18T18:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: AddFrom3DFaces creates additional area</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11305280#M5169</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;, yes, adding boundaries to limit the triangulation works, but only in this contrived example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my actual application things are a bit more complicated. Actually I already have mesh as my surfaces. Mesh as in the sense of a list of points and triangles, and the triangles can be disjointed ( ie: visually you can see two separated "meshes"&amp;nbsp; in this one big Mesh data structure), or it can contain holes ( you can imagine it as a mesh where the internal triangles and edges and points are being deleted).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now what I am doing for this thread is that, instead of PolyFaceMesh, I use Face to represent my mesh ( &lt;A href="https://forums.autodesk.com/t5/civil-3d-customization/system-argumentexception-value-does-not-fall-within-the-expected/td-p/11298947" target="_blank" rel="noopener"&gt;I tried to use PolyFaceMesh and I ran into a problem, most likely a bug&lt;/A&gt;). One triangle, one face.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you can imagine the difficulties here, from visual inspection it's easy to tell where are all the boundaries ( how should we clip the Surface), but from code, it's pretty hard.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because of this, I would think that AddFrom3DFaces is not suitable for my operation, but AddFromPolyFaces is. However AddFromPolyFaces method has its own problem..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I miss anything? What do you think?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 02:03:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11305280#M5169</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2022-07-19T02:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: AddFrom3DFaces creates additional area</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673313#M5170</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebberHu_0-1673488755751.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1161592iCC7FAE5245A5C1E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebberHu_0-1673488755751.png" alt="WebberHu_0-1673488755751.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can try the Maximum Angle to remove the additional area. It seems to me the API creates a convex from all the points of the 3d faces.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 02:01:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673313#M5170</guid>
      <dc:creator>WebberHu</dc:creator>
      <dc:date>2023-01-12T02:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: AddFrom3DFaces creates additional area</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673398#M5171</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6785245"&gt;@WebberHu&lt;/a&gt;&amp;nbsp;, seems like a hack to me. Are you sure it works 100% of the time?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 03:27:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673398#M5171</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2023-01-12T03:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: AddFrom3DFaces creates additional area</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673403#M5172</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7472042"&gt;@soonhui&lt;/a&gt;&amp;nbsp;I am sure. If it does not work, try 89.9. I think you can also find the max angle in&amp;nbsp;SurfaceBuildOptions. And yes, I agree, it does not seem to be a perfect solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 03:31:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673403#M5172</guid>
      <dc:creator>WebberHu</dc:creator>
      <dc:date>2023-01-12T03:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: AddFrom3DFaces creates additional area</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673517#M5173</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6785245"&gt;@WebberHu&lt;/a&gt;&amp;nbsp;, I don't think what you said is a good idea. Because I will need a generic solution because that solution should be implemented in code. So fiddling with Max Angle on case to case basis and hoping that it works, is a no no for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 05:21:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/addfrom3dfaces-creates-additional-area/m-p/11673517#M5173</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2023-01-12T05:21:23Z</dc:date>
    </item>
  </channel>
</rss>

