Jump to content

konstantin magnus

  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won


konstantin magnus last won the day on February 15

konstantin magnus had the most liked content!

Community Reputation

234 Excellent


About konstantin magnus

  • Rank
    Houdini Master

Contact Methods

  • Website URL

Personal Information

  • Name
  • Location
    Stuttgart, Germany

Recent Profile Visitors

5,471 profile views
  1. Distribute by size

    Merge all objects, pack them after connectivity and lay them out with a for loop which sums up all widths plus the spacing. This detail wrangle code is not sufficient but should give you an idea: float space = chf('space'); float shift = 0.0; for(int i = 0; i < npoints(0); i++){ float bounds[] = primintrinsic(0, 'packedbounds', i); float width = bounds[1] + abs(bounds[0]); vector pos = set(shift, 0.0, 0.0); setpointattrib(0, 'P', i, pos, 'add'); shift += width + space; } distribute_objects.hiplc
  2. I am trying to fit a 2d mesh between 4 curves. Pretty much what the skin SOP does but potentially with a custom mesh. vector bbox = relbbox(0, v@P); function vector blerp(vector a, b, c, d; float x, y){ vector lr = a * (1.0 - x) + b * (x); vector tb = c * (1.0 - y) + d * (y); return 0.5 * (lr + tb); } vector p0 = primuv(1, 'P', 0, bbox.z); vector p1 = primuv(1, 'P', 1, bbox.x); vector p2 = primuv(1, 'P', 2, bbox.z); vector p3 = primuv(1, 'P', 3, bbox.x); v@P = blerp(p0, p2, p1, p3, bbox.x, bbox.z); How can I smoothly interpolate the point positions so the borders actually touch the curves? blerp.hiplc
  3. Spiral around mesh

    Unwrap the mesh (right) before deformation (left): Assign zigzag UVs to the curve (right) and transfer positions from the mesh based on both UVs (left): spiral_mesh.hipnc
  4. Curves Boolean

    Isn't just boolean with 'resolve self-intersections' and divide with 'removed shared edges' sufficient? curve_boolean.hiplc
  5. Tiled export of Heightfield terrain Mesh

    It should be sufficient to simply replace bgeo by obj in the code, I think.
  6. PolyExtrude in VEX

    Hi Ryuji, you can inset a polygon or polyline with these steps: vector next = normalize( point(0, 'P', (@ptnum + 1) % @numpt) - v@P ); vector prev = normalize( v@P - point(0, 'P', (@ptnum - 1) % @numpt) ); vector avg = normalize(next + prev); vector up = normalize( abs(cross(prev, avg)) ); vector in = cross(avg, up); float dist = dot(next, avg); vector dir = in / dist; v@P += dir * chf('extrude'); Kim Goossens discusses this here: https://www.youtube.com/watch?v=tnDqwcNG20Y
  7. SQL for Houdini

    Wouldnt that be possible with Python already or what exactly do you have in mind?
  8. Tiled export of Heightfield terrain Mesh

    Hi Mani, they all work except no.1, hence the thread. Petz` scripts (variants 3 to 5) write bgeo-files to the location where your houdini file is located. You can tell by: filePath = hou.hscriptExpandString("$HIP") Variant 2 was mine, but I found it visually too wasteful for just saving. Variant 3 uses some Python code inside the file node to increment the file names. Just click on the label 'Geometry file' to see it. 2 and 3 are related but Petz` variant is more compact. Variant 4 packs the fragments which makes handling and in this case exporting much easier. getEmbeddedGeometry() inside hou.PackedGeometry class seems crucial here. Variant 5 utilizes a Python SOP with two loops: First assigns the segment number to each primitive and the second deletes all non-related primitives before writing out all left-overs. Just look in your folder: You should get a list of objects ranging from part_0.bgeo to part_24.bgeo. The nodes just dont overwrite each others files, I think.
  9. Tiled export of Heightfield terrain Mesh

    Petz solved this issue a few weeks ago:
  10. Carve Contour Lines In Car Body

    Hi Adam, Akira Saito has probably voronoi-fractured the shell and minimized each surface. Reminds me of what BMW has concepted with 'GINA' or of a Zeppelin for that matter. Here is an exemplary workflow: fracture_smooth.hiplc
  11. Custom Lambert - Problems with Light Position

    Hi Jonas, I attached a simple scene that does shading based on the dot product of the surface normal and the normalized light direction. It includes a SOP-variant in VEX and a VOP-shader. Also Yancy Lindquist recently published an extensive tutorial on shading concepts: If all you want is a lambertian toon shader you can also watch mine: light_angle.hip
  12. "Make circle" SOP?

    Thank you again @petz for posting a mathematical solution. I am currently trying to apply it to another mesh (fig. 1). Unfortunately most of the points get collapsed (fig. 2). Is there anything I am missing out? Meanwhile I was trying to come up with a simple solution on my own (fig. 3), which is not unifying the distances between the points along a circle but is averaging out their distance towards the center. Unfortunately I would not quite know how to flatten my points on an oblique plane based on their average normal (fig. 4). human.hiplc
  13. Extrude by colour

    It is better to paint on a black surface right away, because that way all color channels are initially set to 0. After painting you should promote colors to primitives, because this is what primitive extrude is working with. If however you have chosen to paint red on white, the red channel will be set to 1 everywhere. Red = 1,0,0 and White = 1, 1, 1. Thats why the green or blue channel is more distinctive here: Set your primitive wrangle to f@r = 1.0 - @Cd.g; so its able to tell where red is being used. Inside the primitive extrude set 'distance' to something larger than 0 and set 'distance scale' to r. exturde by color_corr.hiplc
  14. VEX selecting border edges

    Set a normal node to 'points' and put this in an attribute wrangle: if( max( abs(v@N) ) < 0.9 ){ int nbs[] = neighbours(0, @ptnum); foreach(int nb; nbs){ if(nb > @ptnum){ vector nml = point(0, 'N', nb); setedgegroup(0, 'outer_edges', @ptnum, nb, max(abs(nml)) < 0.9); } } } box_edges.hiplc
  15. Connecting points in vex

    Leaving out the constraint about no PC2 point used twice, it would be just this between both point clouds: int connections = 10; for(int i = 0; i < connections; i++){ int pt_PC2 = int( rand(@ptnum + 45 * i) * npoints(1) ); vector pt_pos = point(1, 'P', pt_PC2); int pt_add = addpoint(0, pt_pos); int prim_add = addprim(0, 'polyline', @ptnum, pt_add); } With sorting out points however you will probably need a sequentiell approach using arrays. connect_point_clouds.hiplc