SDF from Curves?

   2977   9   2
User Avatar
Member
385 posts
Joined: 7月 2018
Offline
I havent used sdf before but i wanted to try a technique i had in mind to calculate distances between curves using SDF and output a contour at a specific value. i want to input thousands of curves so it has to be light calculation-wise.How can i implement this in 2d? i have no surface or volume just curves. I tried using volume rasterize curve but nothing shows up. Any tips? tutorials i can watch that can get me started?
Edited by papsphilip - 2019年7月27日 09:18:19

Attachments:
CURVE_SDF.hip (163.7 KB)

User Avatar
Member
160 posts
Joined: 2月 2016
Offline
This tool should help. I use it regularly.
https://github.com/mattebb/hda/tree/master/volume_rasterize_lines [github.com]
User Avatar
Member
385 posts
Joined: 7月 2018
Offline
Aslak K-S
This tool should help. I use it regularly.
https://github.com/mattebb/hda/tree/master/volume_rasterize_lines [github.com]
thats exactly what i'm looking for, but how can you output a curve at the end? like sampling the volume at a specific value
User Avatar
Member
160 posts
Joined: 2月 2016
Offline
I don't quite get what you mean “output curve at the end”.

Look into Volume Sample. https://www.sidefx.com/docs/houdini/nodes/vop/volumesamplefile [www.sidefx.com]
I think that's what you are looking for.
User Avatar
Member
385 posts
Joined: 7月 2018
Offline
Aslak K-S
I don't quite get what you mean “output curve at the end”.

Look into Volume Sample. https://www.sidefx.com/docs/houdini/nodes/vop/volumesamplefile [www.sidefx.com]
I think that's what you are looking for.

sorry i didnt phrase that correctly i need the contour of the volume at a specific value. Like contours of a terrain! maybe through cops?
User Avatar
Member
160 posts
Joined: 2月 2016
Offline
Something along the lines of this?
https://vimeo.com/302984643 [vimeo.com]
User Avatar
Member
160 posts
Joined: 2月 2016
Offline
Quick setup.

Attachments:
CURVE_SDF_v01.hiplc (236.8 KB)
Screenshot from 2019-07-27 19-17-08.png (566.2 KB)

User Avatar
Member
385 posts
Joined: 7月 2018
Offline
Aslak K-S
Something along the lines of this?
https://vimeo.com/302984643 [vimeo.com]

ok not quite what i was looking for because i dont have heightfields and i dont know a way to convert a volume into a heightfield but i think i found a simpler way through cops using a trace afterwards.i thought this would be way easier though, like using a trail sop. this is supposed to be a standard mathematical procedure, by doing in sops there is a big disadvantage which is volume resolution. The quality of the final trace/contour depends on that. So if you had a million curves i suppose this method would be the wrong way to go. Anyway check my example scene, i used the github asset you mentioned and added some things.

Attachments:
volume_to_contours.hiplc (222.1 KB)

User Avatar
Member
28 posts
Joined: 11月 2013
Offline
I think using trace is your best option for something like this. Although you need to have a high resolution volume to get decent lines from it.
You can use the trace node in a loop to get these isolines.
I am curious if there is a better solution for this.

Attachments:
Curve_SDF_test.hip (162.3 KB)

User Avatar
Member
385 posts
Joined: 7月 2018
Offline
Aslak K-S
This tool should help. I use it regularly.
https://github.com/mattebb/hda/tree/master/volume_rasterize_lines [github.com]
i ugraded this asset to a licensed version, here it is
i dont know how to upload it to github so if someone is familiar with this please do so

Attachments:
Curve_Raterization_v2.hda (11.6 KB)

  • Quick Links