Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

csg_round

CSG Round


Description

CSG Round

Usage

csg_round(object, radius = 0.1)

Arguments

object

CSG object.

radius

Default '0.1'. Rounding distance.

Value

List describing the triangle in the scene.

Examples

#Generate a rounded pyramid:
generate_ground(material=diffuse(checkercolor="grey20")) %>% 
  add_object(csg_object(csg_pyramid(x=-1,y=-0.99,z=1),
                        material=glossy(color="red"))) %>% 
  add_object(csg_object(csg_round(csg_pyramid(x=1,y=-0.89)),
                        material=glossy(color="blue"))) %>% 
  add_object(csg_object(csg_round(csg_pyramid(x=0,z=-2,y=-0.5), radius=0.5),
                        material=glossy(color="green"))) %>% 
  add_object(sphere(y=5,x=5,z=5,radius=1,material=light(intensity=50))) %>% 
  render_scene(lookfrom=c(-3,4,10), fov=22, 
               lookat=c(0,-0.5,0),clamp_value=10)

#Round a blend of two objects
generate_ground(material=diffuse(checkercolor="grey20")) %>% 
  add_object(csg_object(csg_round(csg_combine(
    csg_pyramid(x=-0.5,y=-0.99,z=1.5),
    csg_pyramid(x=0.5,y=-0.99,z=2), operation="blend"), radius=0),
                        material=glossy(color="red"))) %>% 
  add_object(csg_object(csg_round(csg_combine(
    csg_pyramid(x=-0.5,y=-0.79,z=-1.5),
    csg_pyramid(x=0.5,y=-0.79,z=-1), operation="blend"), radius=0.2),
                        material=glossy(color="green"))) %>% 
  add_object(sphere(y=5,x=5,z=5,radius=1,material=light(intensity=50))) %>% 
  render_scene(lookfrom=c(-3,5,10), fov=22, 
               lookat=c(0,-0.5,0),clamp_value=10)

rayrender

Build and Raytrace 3D Scenes

v0.21.2
GPL-3
Authors
Tyler Morgan-Wall [aut, cph, cre] (<https://orcid.org/0000-0002-3131-3814>), Syoyo Fujita [ctb, cph], Melissa O'Neill [ctb, cph], Vilya Harvey [ctb, cph]
Initial release
2021-04-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.