Skip to content

Allow explicit constraints on subset of the triangles #71

Open

Description

@abhi-k9

Is there a way to allow explicit triangle positions after the flattening?

A       = { all triangles. }
A_fixed = { all triangles with explicit mapping. }
A_free  = A - A_fixed

Flatten A_free while honoring the given mapping for A_fixed. In my case the A_fixed maps the triangles onto a planar surface, hence they are flattened.

Thanks.

Activity

  1. csparker247 commented on Mar 26, 2026

    @csparker247
    Member

    I think what you're talking about would be provided by #42, which is planned for LSCM but not implemented. When running, you would have to:

    • Run ABF (if you're using that)
    • Use the optimized angles to define the position of your fixed triangle(s).
    • Pin all vertices of the fixed triangle(s) to known locations as an input to LSCM.

    Fixing full triangles will eventually create an over constrained system and, depending on the 3D surface, may produce worse results than just running the algorithm on the full mesh.

    Why are you interested in this? What are you trying to accomplish?

  2. abhi-k9 commented on Mar 27, 2026

    @abhi-k9
    Author

    That's great!

    I have a portion of a surface S facets facets_p already flattened. It has to be a portion of the facets since facets_p boundary is connected to the facets on another surface S2 and so on. All these facets from different surfaces are flattened together.

    Now, the rest of the surface S facets facets_r := facets - facets_p also need to be flattened while maintaining the flattened vertex positions on the boundary of facets_p. That's where the pinning will take place.

    Does that make sense, or I could add more details.

    Thanks.

  3. csparker247 commented on Mar 28, 2026

    @csparker247
    Member

    Yes, that makes sense. Is there a reason why all facets can't be reflattened together, though?

  4. abhi-k9 commented on Mar 28, 2026

    @abhi-k9
    Author

    Below is the geometry I have F1, F2, F3 are the faces to unfold. These must end up without self-intersections after the unfold. Now, S1, S2, and S3 (omitted in the image for clarity) are the surfaces defining the faces that also need to be unfold while maintaining their boundary facet edges with the respective faces, i.e. the boundary facet edges between Si and Fi should lie at the same position after unfold. This is where I plan to apply the pinning constraints. I do not care whether these surface unfolds intersect with other faces/surfaces as long as it does not intersect with the face it defines, i.e. Si unfold should not overlap with Fi unfold.

    Image

    I imagine it would be very hard to control the flattening process with such requirements along with a non-manifold mesh.

    Again, it's a bit hard to explain in words here, but I'll be happy to add more details if you are interested.

  5. csparker247 commented on Mar 28, 2026

    @csparker247
    Member

    Let me make sure I'm interpreting the diagram correctly:

    • You have a surface S composed of 3 parts S1-3, where the last two parts bifurcate from the first to create a y-intersection (non-manifold).
    • Each S has a subset of faces F and you want to maintain the interior boundary Bi between Si and Fi after flattening. The diagram doesn't show this, but it seems like you might already have the flattened boundary Bi, and you don't want this to change in shape at all.
    • You don't care if a flattened Si or Fi intersects with another Sj or Fj, as long as it doesn't intersect with its i counterpart.
    • So for this particular example, you'd want three flattened charts.

    If all of that's correct, then there are a few things to think about:

    • The HalfEdgeMesh structure in this project requires a manifold mesh. If what I've described about the manifoldness above is accurate, then you'd need to split your surfaces into manifold components Si before running them here. It sounds like the independent flattening wouldn't be a problem in terms of the results (i.e. you don't care if they intersect across S), but I'm not sure how easy it is to decompose your surface into manifold components.
    • Is Fi a subset of Si? And is Bi pre-determined? If Fi is in Si and Bi is not predetermined, why can't you just flatten Si? This library does not introduce splits at any edges on its own, so your boundary will be maintained (though it will be arbitrarily positioned in the output).
    • If Bi is pre-determined, then you will have to wait for A7: Multi-pin UV constraints for LSCM #42. The flattening results will vary greatly depending on the exact surfaces and boundaries involved. I'm not really sure what LSCM will do when you have two separate regions of conformal energy divided by a pinned boundary.
  6. abhi-k9 commented on Mar 28, 2026

    @abhi-k9
    Author
    1. In this case, yes. In general, the faces form a manifold body and meet each other at boundaries Bij. The surfaces may extend beyond these boundaries leading to an "X" like intersection at Bij.
    2. Yes, all the faces have been flattened together. Now the surfaces have to be flattened in such a way that the Si- Fi boundary ends up at the same position again as it did when we flattened all the faces together.
    3. Fi should NOT intersect with any other Fj, which I assume the algorithm handles when we flatten all faces together. Now, any Si should NOT overlap with it corresponding face Fi after flattening, but rather just meet with it at the pre-flattened boundary. The flattened Si may overlap with anything other than Fi (i.e. Fj or Sj where i!=j).
    4. Right. Depends on how you count though. As I have it right now, one chart will be the flattened mesh from all faces together. And the one from each surface flattened while pinning the facet edges at the boundary with its face.

    Thanks for your insights!

    1. Yeah, the faces form a manifold. The surface facets in the Si-Fi region individually are manifold as well.

    2. Yes always. The faces are contained by the surfaces. The surfaces are a larger patch and the face is a reduced portion of it defined by its boundary on the surface. I cannot flatten just Sis individually cause then the boundary edges (connecting Fi and Fj together for example) would end up at different places. That boundary connection has to be unique on the flattened mesh. This is guaranteed when I flatten all faces together.

    3. Right, I hope it would honor the pinning on the surface-face boundary.

    Thanks again! I may be able to assist you with coding the enhancement in. Currently going through the ABF papers and understanding the math.

  7. csparker247 commented on Mar 28, 2026

    @csparker247
    Member

    This should largely leave the ABF classes untouched, and most of the work would be in the interface for AngleBasedLSCM, which actually does the pinning. ABF -generated angles should just work as is since ABF is more or less just a pre-optimization step for LSCM. I also probably leave HLSCM untouched for the moment, as it performs a multi-scale decimation and mapping the high-level pins to the decimation would take some extra thought.

    If you want to contribute, you should take a look at conductor/tracks/A7. I've recently started using Claude Code with this conductor plugin to follow a TDD development workflow. You don't have to use it, but I probably will review against its spec.

  8. changed the title [-]Allow explcit constraints on subset of the triangles.[/-] [+]Allow explicit constraints on subset of the triangles[/+] on Mar 28, 2026
  9. csparker247 commented on Jun 15, 2026

    @csparker247
    Member

    @abhi-k9 Multi-pinning is now available in the develop branch. Depends on whether you're using the functional or class interface, but basically you create a list of the vertex indices and their UV coordinates and pass that list to the LSCM::Compute method:

    PinMap pins{
    {0u, Vec<float, 2>{0.f, 0.f}},
    {1u, Vec<float, 2>{2.f, 0.f}},
    {2u, Vec<float, 2>{1.f, std::sqrt(3.f)}},
    };
    LSCM::Compute(mesh, pins);

    Let me know how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions