POV-Ray : Newsgroups : povray.binaries.images : More isosurface extrusions of 2D SDFs : More isosurface extrusions of 2D SDFs Server Time
7 Jan 2025 23:52:44 EST (-0500)
  More isosurface extrusions of 2D SDFs  
From: Chris R
Date: 23 Dec 2024 14:10:00
Message: <web.6769b4a9eeabe52ed30e597d5cc1b6e@news.povray.org>
I added most of the 2D SDF functions from Inigo's site to my library as well as
a few new utilities for manipulating them.

The rendering shows a 2D SDF generated by starting with an Iso_fixed_2d_box and
an Iso_fixed_2d_circle.  I used Translate_fn_2d (from my libfn.inc library) to
put the circle on the upper right corner of the box and then create a smooth
union sdf from those two functions:

#local _box_size = <1,1>;
#local _circle_r = 0.25;
#local _sdf_box = Iso_fixed_2d_box(_box_size)
#local _sdf_circle = Iso_fixed_2d_circle(_circle_r)
#local _sdf_circle2 = Translate_fn_2d(_sdf_circle,
<_box_size.x/2,_box_size.y/2>)
#local _k = 0.2;
#local _union_fn = Iso_fixed_smooth_union(_k)
#local _sdf1 = function(x,y) {
   _union_fn(_sdf_box(x,y),_sdf_circle2(x,y))
}
#local _sdf = Iso_fixed_2d_annular(_sdf1,0.1)

I created the 4 different views by creating isosurfaces functions:

Iso_fixed_rotation(_sdf,Radius)
Iso_fixed_extrusion(_sdf,Length) (the second one is just rotated and translated
for another view)
Iso_fixed_helix_extrusion(Radius,Rise,Direction,_sdf)

The updated library code is here: https://github.com/carath63/povlibrary

-- Chris R


Post a reply to this message


Attachments:
Download 'libisoshapes_test.png' (171 KB)

Preview of image 'libisoshapes_test.png'
libisoshapes_test.png


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.