gradientspace / geometry3Sharp

C# library for 2D/3D geometric computation, mesh algorithms, and so on. Boost license.
http://www.gradientspace.com
Boost Software License 1.0
1.69k stars 380 forks source link

mesh borders are diagonal. #179

Closed ddov123 closed 2 years ago

ddov123 commented 2 years ago

Hi! first I apologize for my bad English, and thanks for providing the great library.

I used MeshExtrudeLoop to stretch the borders, but borders are diagonal.

        DMesh3 mesh = TestUtil.LoadTestInputMesh("plane_250v.obj");
        MeshBoundaryLoops loops2 = new MeshBoundaryLoops(mesh);
        EdgeLoop eLoop = new EdgeLoop(mesh);
        eLoop.Edges = loops2[0].Edges;
        eLoop.Vertices = loops2[0].Vertices;

        new MeshExtrudeLoop(mesh, eLoop)
        {
            PositionF = (Func<Vector3d, Vector3f, int, Vector3d>)((v, n, vid) => v * 1f)
        }.Extrude();
        TestUtil.WriteTestOutputMesh(mesh, "zzzz.obj");

image why diagonal?

ddov123 commented 2 years ago
new MeshExtrudeLoop(mesh, eLoop)
        {
            PositionF = (Func<Vector3d, Vector3f, int, Vector3d>)((v, n, vid) => v * 1f)                  // this
                                                                                                               ↓
            PositionF = (Func<Vector3d, Vector3f, int, Vector3d>)((v, n, vid) => v + Vector3d.AxisZ * 1f) // fix this
        }.Extrude();