csg_round: CSG Round

Description Usage Arguments Value Examples

View source: R/csg_construct.R

Description

CSG Round

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#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 documentation built on April 7, 2021, 5:06 p.m.