Jump to content
  1. General

    1. 26.3k
      posts
    2. 2.1k
      posts
    3. 1.6k
      posts
    4. Marketplace

      For all commercial tools, HDA's etc.

      417
      posts
  2. Houdini

    1. 64.6k
      posts
    2. 48.5k
      posts
    3. 12.2k
      posts
    4. 4.9k
      posts
    5. 15k
      posts
    6. 1k
      posts
    7. 687
      posts
    8. 647
      posts
  3. Coders Corner

    1. 6.3k
      posts
    2. 13.2k
      posts
    3. 4.8k
      posts
  4. Art and Challenges

    1. 3.4k
      posts
    2. 9.8k
      posts
    3. 572
      posts
    4. Effects Challenge Archive

      This is where the cool unofficial challenges live on!

      296
      posts
  5. Systems and Other Applications

    1. Other 3d Packages

      Maya,XSI,Blender,etc

      1.6k
      posts
    2. 1.5k
      posts
    3. Hardware

      Graphics cards etc.

      2.1k
      posts
    4. 413
      posts
  6. od|force

    1. 1.5k
      posts
  • Posts

    • Could you use the Sort by Proximity feature in the Sort node ? This "breaks" the order, but gives a starting point for each curves, which can be leveraged with some logic. Here's my take on it align_curve_starts.hipnc
    • If the point number per prim is different, you can workaround it by resampling all primitives with same count. After this you can capture each point from the original curve using xyzdist() and reorder the vertices based on their u-param. It may be a bit less accurate.   align_curve_starts_modA.hipnc
    • Thanks a lot. I just checked it - however, it seems to break if I feed curves with different point counts. For instance, if I resample one of the circles it doesn't line up anymore.
    • Hello, if you have a set of curve (I would prefer always closed ones, so no you don't have repeating points), you can measure the the distance between all point pairs and sum them up and doing this for all offsets (0, 1, 2, ... number of prim). After this there should be an optimal offset (with minimum distant sum). You can do this for all curve pairs and get the relative offset from curve i to curve i-1 etc... .   align_curve_starts_mod.hipnc
    • Hello, I'm working on a custom g-code slicer and one problem I encounter is that I don't know how to align the curve start/end points of vertically stacked closed curves. I want the start points to be close together, to minimize the travel between layer changes and to move the seams to the back of the print. I've attached a simplified example with two curves, one of them rotated. I want to check and rotate each of them so that the start point is the point that has an x-coordinate closest to x=-1. Just for demo purposes here. I am doing the point sorting in an attribute wrangle which has multiple problems I'm afraid. I hope someone can help me out. I checked these solution but they all work with simple shifts, I need to shift each curve differently. Here's the vex: for(int c = 0; c < nprimitives(0); ++c) {     float minX = -1;     int minIndex = -1;     float minDistance = 1e30;          int cPoints[] = primpoints(0, c);     int numPoints = len(cPoints);     for (int i = 0; i < numPoints; ++i)     {         vector P = cPoints[i];          float distance = abs(P.x - minX);              if (distance < minDistance)         {             minDistance = distance;             minIndex = i;         }     }          int newIndexArray[] = array(numPoints, 0);          for (int i = 0; i < numPoints; ++i)     {         newIndexArray[i] = (minIndex + i) % numPoints;         // that would break for curves with different point counts:         setpointattrib(geoself(), "newindex", i + (c * numPoints), newIndexArray[i], "set");     } } I know one problem is mixing absolute point index and index within primpoints but I don't know how to best solve it. align_curve_starts.hipnc
  • Topics

×
×
  • Create New...