AntoineSfx
Members
Content count
88 
Donations
0.00 CAD 
Joined

Last visited
Everything posted by AntoineSfx

Probably a bit beyond the scope of the question, but I will leave this link here::

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 ?

DouglasPeucker polygon simpification
AntoineSfx replied to AntoineSfx's topic in General Houdini Questions
This works. Polyreduce doesn't reduce polygons though, as I suspected from the documentation. 
So , I assume it is not implemented by any node, otherwise I would have found that term ( DouglasPeucker ) 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.

DouglasPeucker polygon simpification
AntoineSfx replied to AntoineSfx's topic in General Houdini Questions
Thanks, it wasn't clear from the doc that it also applied to polygons. 
Find the center of a deforming tube with Vex
AntoineSfx replied to midicon's topic in General Houdini Questions
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.. 
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== @numpt1) 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 ?

Why does a part of this code runs only once in VEX ?
AntoineSfx replied to AntoineSfx's topic in Scripting
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. 
Why does a part of this code runs only once in VEX ?
AntoineSfx replied to AntoineSfx's topic in Scripting
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 builtin in the BNF. However it doesn't explain why I have that behavior on the original code. 
How to make a skinned sweep that can be subdivided ?
AntoineSfx replied to AntoineSfx's topic in Modeling
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. 
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.

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.

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 nuple 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.

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 ?

Define a function in point wrangle
AntoineSfx replied to AntoineSfx's topic in General Houdini Questions
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 .. 
Define a function in point wrangle
AntoineSfx replied to AntoineSfx's topic in General Houdini Questions
This solves my problem. May I ask where you have found this ? Is there a BNF for VEX ? 
Define a function in point wrangle
AntoineSfx replied to AntoineSfx's topic in General Houdini Questions
actually .. a lot a functions do that. I need a more powerful version of neighbours, hence the question in the first place. 
Define a function in point wrangle
AntoineSfx replied to AntoineSfx's topic in General Houdini Questions
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; } 
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.

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/why0point1doesnotexistinfloatingpoint/

maybe not what you want, but carve also move points on a curve.

How does the hold shift to move off the construction plane work ?
AntoineSfx posted a topic in General Houdini Questions
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. 
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.

Set a digital asset parameter value after copy node
AntoineSfx posted a topic in General Houdini Questions
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 ? 
It looks perfect judging from the thumbnail and the first 10 seconds. Thanks.