Giter Club home page Giter Club logo

Comments (11)

rms80 avatar rms80 commented on August 19, 2024

sorry, I don't 100% understand what you are asking. I'm not sure what you mean by "flat mesh" - do you mean this was originally a curved patch, and you have to convert to triangles?

from geometry3sharp.

KisliPlug avatar KisliPlug commented on August 19, 2024

I've attached an example of a fragment that can not be simplified and an entire geometry, you can see it in here https://3dviewer.net /. I mean the geometry of a facet of an object.

from geometry3sharp.

rms80 avatar rms80 commented on August 19, 2024

yes i looked at the attachment. I don't understand what your question/problem is.

from geometry3sharp.

KisliPlug avatar KisliPlug commented on August 19, 2024

I can not simplify with the help of Reducer, such parts, whole meshes are normally simplified, and such fragments not , I wanted to clarify whether it is possible to merge such fragments into a one mesh, or to find out the reason why this method does not work.
I'm using the following code for simplify :
var red = mn.Select(x => new Reducer(x));
foreach ( var r in red ) {
r.SetExternalConstraints(new MeshConstraints());
MeshConstraintUtil.FixAllBoundaryEdges(r.Constraints, r.Mesh);
DMeshAABBTree3 tree = new DMeshAABBTree3(new DMesh3(r.Mesh));
tree.Build();
MeshProjectionTarget target = new MeshProjectionTarget(tree.Mesh, tree);
r.SetProjectionTarget(target);
r.ProjectionMode = Reducer.TargetProjectionMode.Inline;

r.ReduceToTriangleCount(200);

}
mn = mn.Select(x => new DMesh3(x, true)).ToList();

from geometry3sharp.

rms80 avatar rms80 commented on August 19, 2024

So you are trying to reduce the attached fragment with this code? It won't do anything, there are only 112 triangles (you are trying to reduce to 200).

If you want to connect up the borders of a bunch of fragments, it depends on whether the boundaries match. If they do not, this is a very hard problem, I would suggest trying Make Solid in Autodesk Meshmixer, with repair turned off. If they do line up, DMesh3.MergeEdges() will let you join pairs of edges, but you will have to match them. Alternately you can construct a unique vertex map and then rebuild the mesh w/ the vertices shared. A quick-and-dirty way to do this is just to write it out as an STL and read it back in, the STL reader does this internally.

from geometry3sharp.

KisliPlug avatar KisliPlug commented on August 19, 2024

This fragment is for example, and in this case (200) nothing will happen, but if you make 50, it will still not happen and the number of triangles will be the same.
Thank you, I will try to follow your advice.

from geometry3sharp.

rms80 avatar rms80 commented on August 19, 2024

none of the triangles are connected (blue edges are border edges):
image

So when you do MeshConstraintUtil.FixAllBoundaryEdges(), it tells the reducer it cannot modify any of the edges.

use the write/read STL thing I mentioned and it will work, at least for an individual patch.

from geometry3sharp.

KisliPlug avatar KisliPlug commented on August 19, 2024

Thank you, I will use your advice!

from geometry3sharp.

KisliPlug avatar KisliPlug commented on August 19, 2024

And to unite these faces without re-export is possible? The point is that when I load such fragments, I get an error, maybe I can recreate a grid from a set of meshes and triangles?

from geometry3sharp.

rms80 avatar rms80 commented on August 19, 2024

If you look at STLReader.BuildMesh_IdenticalWeld, you will see that the way it is done is quite simple to reproduce directly on a DMesh3. Just build a hash table of vertices, assign each a unique ID, and use that to remap the triangle IDs

from geometry3sharp.

KisliPlug avatar KisliPlug commented on August 19, 2024

Thank you

from geometry3sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.