Replies: 4 comments 4 replies
-
If you're using C++, our tests are a good place to start. Likewise, if you run into a problem, writing a new Your supplied code doesn't appear to assign any OriginalIDs at all? Also, I'd recommend using only |
Beta Was this translation helpful? Give feedback.
-
Hi Emmett, I have coded a small code snippet, which demonstrates what I trying to do. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi Emmett,
Thank you for your answer. I really want to process multi-colored input for
each operand of union to become versatile enough for
my intent. This means I want to start off with the last approach with
different colors on different faces.
My Problem right now is that I don't have any clue about the
orgiginalID concept you are referring to. supposedly you are referring to
the runOriginalID property and it appears that I can specify at most one
for each input ?
If I have 2 inputs to union and both are partially red and partially green,
does it mean that I need to use 4 different runOriginalID's ?
Will I have to run 2 x 2 runs like:
red union red
red union green
green union red
green union green ?
will manifold work correctly when only seeing red faces on 1st input which
is not manifold alone ?
Right now its rather hard to me see the correct strategy to union multi
colored inputs , basically I am lost. Would it be at least possible to add
sketches to my code and guide me to the right direction ?
Thank you for your attention.
…On Tue, Feb 20, 2024 at 6:50 PM Emmett Lalish ***@***.***> wrote:
Thanks, I see the problem now. The faceID really is meant for IDing faces,
not materials. Since your materials are uniform across a given cube,
originalID is a better solution here. You can make a map of OriginalID ->
color, and then the output MeshGL will be sorted into two triangle runs,
one per ID/color.
If you want your inputs to have difference colors on different faces,
you'll want to sort those into triangle runs with separate originalIDs in a
similar way.
—
Reply to this email directly, view it on GitHub
<#749 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCO4MV4IQA25JVLPOHCYOTYUTO7FAVCNFSM6AAAAABDQEL4O6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKMZTGM3TQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
thank you for your answer. using information from faceID together with runIndex helped me to solve the problem. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'd like to use runOriginalID' property for finding this info in the output when setting in the input.
When my input cube has 12 triangles, I supply 12 runOriginalID's
I have this code .:
mesh.vertPos.resize(ps_tri->vertices.size());
for(int i=0;i<ps_tri->vertices.size();i++) {
Vector3d pt=ps_tri->vertices[i];
mesh.vertPos[i] = glm::vec3((float) pt[0], (float) pt[1], (float) pt[2]);
}
mesh.triVerts.reserve(ps_tri->indices.size());
for(int i=0;i<ps_tri->indices.size();i++) {
auto &tri = ps_tri->indices[i];
assert(tri.size() == 3);
mesh.triVerts.emplace_back(tri[0], tri[1], tri[2]);
}
manifold::MeshGL meshgl(mesh);
std::vector originalID's;
/* from Documention: at
https://manifoldcad.org/docs/html/structmanifold_1_1_mesh_g_l.html
Optional: The OriginalID of the mesh this triangle run came from. This ID is ideal for reapplying materials to the output mesh. Multiple runs may have the same ID, e.g. representing different copies of the same input mesh. If you create an input MeshGL that you want to be able to reference as one or more originals, be sure to set unique values from ReserveIDs(). */
meshgl.runoriginalIDfaceID = originalID;
Did some trials but I always get an vector out of range error.
I could not figure out, how to properly create values for the originalID's vector. ReserveID's creates weird output values depending on the input and even if i use them, the error persists.
Can I find sample code somewhere ?
Beta Was this translation helpful? Give feedback.
All reactions