Jump to content

AntoineSfx

Members
  • Content count

    88
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Everything posted by AntoineSfx

  1. Combining two Primitives

    Probably a bit beyond the scope of the question, but I will leave this link here::
  2. Is there a way to have one parameter control that would have no more individual controls than required to encode all the necessary values to define this furniture ? Ideally, something like one float ramp, which would serve as a way to define the segments in the x direction ({1,1,1} here). Then for each segment, an additional ramp for the other dimension (y) I could somehow encode all of this in something bigger, but it would be less intuitive. Also, how do you access the ramp stops from VEX ?
  3. Douglas-Peucker polygon simpification

    This works. Polyreduce doesn't reduce polygons though, as I suspected from the documentation.
  4. So , I assume it is not implemented by any node, otherwise I would have found that term ( Douglas-Peucker ) sidefx.com This is an algorithm to simplify polygon by removing points that are almost (less than some epsilon) colinear https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm Do you think it would be a nice addition to resample ? Maybe it's already there and I can't find it.
  5. Douglas-Peucker polygon simpification

    Thanks, it wasn't clear from the doc that it also applied to polygons.
  6. Not that it solves your problem, but here is a clarification of the problem you're trying to solve: https://doc.cgal.org/latest/Surface_mesh_skeletonization/index.html At least you have the name of the problem, and one implementation in C++ / CGAL. I'm working on something related, (CGAL + Houdini) maybe it's not that hard to offload some work to CGAL..
  7. Input is a line, I'm trying to set a different pscale attribute on the first and last point. In PointWrangle (Run over Points), I have this: f@pscale=chf("scl") ; float scale=chf("scl"); printf("begin %f\n",scale); printf("numpt=%d\n", @numpt); printf("ptnum=%d\n", @ptnum); if (@ptnum==0 || @ptnum== @numpt-1) f@pscale=chf("scl") ; else f@pscale=1 ; output: (twice the same thing) begin 0.101000 numpt=10 ptnum=0 ptnum=1 ptnum=2 ptnum=3 ptnum=4 ptnum=5 ptnum=6 ptnum=7 ptnum=8 ptnum=9 begin 0.101000 numpt=10 ptnum=0 ptnum=1 ptnum=2 ptnum=3 ptnum=4 ptnum=5 ptnum=6 ptnum=7 ptnum=8 ptnum=9 Is the compiler parallelizing portion of codes which refer to points attributes ?
  8. Why does a part of this code runs only once in VEX ?

    the real question is, why does printf("numpt=%d\n", @numpt); seems to be outside of the points loop, while printf("ptnum=%d\n", @ptnum); seems to be be inside the points loop. I assume some optimization is made on the program, but I can't find exactly what. I know that vcc (or should I say the VM running its output) runs several threads, but it's unclear what happens to the VEX I wrote in that box.
  9. Why does a part of this code runs only once in VEX ?

    Operators precedence is such that non contrived expressions don't require additional parenthesis.. Unless you want to assign the result of a comparison or something. It's built-in in the BNF. However it doesn't explain why I have that behavior on the original code.
  10. How to make a skinned sweep that can be subdivided ?

    Here is how I solved it for simple (regular polygon looking) cross sections: make the first and last point closer to the second and second from last, then set pscale to 0 for the first and last point. then after the skin, fuse the points which are close to each other, and at this point you have the topology of a sphere. This works better if the "radius" of the cross section curve is about the same size of the segments of the sweep profile polygon, to keep the quadrilaterals about the same size. Otherwise, there will be abrupt changes in the curvature ( the same way you do angles in NURBS curves by doubling points) For more complex curves (not convex), I haven't yet found a good solution, because I think this would require to compute the straight skeleton, which is not something which has a good implementation in Houdini. Polyexpand2D is the closest Houdini has to offer, but it seems hard to uses it as a straight skeleton operator. CGAL has it function This works for polygons because the straight skeleton happens to be the center, which is the point where all the vertices converge when scaled to 0.
  11. I can't find a way to take two curves, make a sweep, skin the result, and have an output that is topologically equivalent to a box, so that it subdivides nicely in all directions.
  12. Unroll a planar curve

    Thanks. BTW the search function used by Invision is confusing. I didn't find it for some reason and I almost sent another Hawaii’s missile alert.
  13. Is there a clever way to unroll a planar curve, of course in a progressive way ? The effect I'm trying to achieve is a rug unrolling after an initial impulse , or with the effect of a constant force in a fixed direction. So far, I've tried to stitch curves created to the specifications explicitly (one line + 1 Archimedean spiral) but it's neither very stable nor procedural. This is highly dependent on the parametric equation of the initial curve. I was thinking of doing something like this: once I have the resampled curve as polygon, I could define the whole curve as a n-uple of (vector, angle), angle being the relative angle to the next point. Then flatten the curve by changing all the angles to zero, in a nice ease in / ease out, several points at a time.
  14. How do you define a VEX function in a pointwrangle node ? Using this: int[] myfunc( int input, int ptnum) { int result[]; return result; } Houdini complains about a syntax error at myfunc. What is the correct syntax, and where is it documented ?
  15. Define a function in point wrangle

    ok. Typo.. I meant BNF, the formal definition of the language (Backus normal form) Also, the use case of the keyword function is for nested functions. So I assume the whole VEX block is really run inside a parallel for loop over prim / points ..
  16. Define a function in point wrangle

    This solves my problem. May I ask where you have found this ? Is there a BNF for VEX ?
  17. Define a function in point wrangle

    actually .. a lot a functions do that. I need a more powerful version of neighbours, hence the question in the first place.
  18. Define a function in point wrangle

    So this was an error (; instead of ,) but I still can't get this to compile, because of the array type as return type: int [] myfunc(int input; int ptnum) { int result[]; return result; }
  19. Is there a way to force rendering after I change something in a COP network referenced by op:// in a material ? Right now it doesn't seem to force mantra to render again, which makes tweaking colors a little tedious.
  20. Copy & Paste Relative References

    Also note that you can't represent 1/10 exactly in binary. The value displayed is actually closer to the number used internally than the number you typed. http://www.exploringbinary.com/why-0-point-1-does-not-exist-in-floating-point/
  21. moving

    maybe not what you want, but carve also move points on a curve.
  22. Lately, I don't manage to use it. It looks like it's constraining the point to move on some line that is definitely not "off the construction plane". Are you able to use it ( in 365 ). Maybe I entered a mode that prevents me from using it as I think it should work.
  23. @P = @oldpos -> not working

    Second wrangle should be: @P = v@oldpos; Otherwise, it's doing this really: @P=v@oldpos[0]; Untyped @oldpos is cast into its first component.
  24. Let's say I have a subnetwork: 2 nulls, and one geo, referencing the nulls coordinates and defining one segment. Now in another geometry node, I want to do object merge, copy, then do something on each instance of that subnetwork, like assigning a new value to each null to move the instances on a curve. I'm not sure how to do this. It looks like information would have to flow upstream. Maybe a for loop ?
  25. How to link railroad cars along a polygon

    It looks perfect judging from the thumbnail and the first 10 seconds. Thanks.
×