'iso_bcsg.inc' - Combination of functions and native CSG
This file contains the same macros as the
in iso_csg.inc
include file, they just generate both
the IsoCSG function and the native POV-Ray shape.
Because of this you can't assign the result of those macros to an identifier but have to use nested macros for the whole CSG construction.
There are macros for either extracting the function or the shape as well as for automatic calculation of the container object from the extents of the shape.
-
CSG macros
- IC_BMerge2() merge 2 objects
- IC_BMerge3() merge 3 objects
- IC_BMerge4() merge 4 objects
- IC_BMerge5() merge 5 objects
- IC_BMerge_Array() merge an array of objects
- IC_BIntersection2() intersection between 2 objects
- IC_BIntersection3() intersection between 3 objects
- IC_BIntersection4() intersection between 4 objects
- IC_BIntersection5() intersection between 5 objects
- IC_BIntersection_Array() intersection between an array of objects
- IC_BDifference2() difference between 2 objects
- IC_BDifference3() difference between 3 objects
- IC_BDifference4() difference between 4 objects
- IC_BDifference5() difference between 5 objects
- IC_BDifference_Array() difference between an array of objects
- IC_BInverse() invert an object
- Shape macros
-
Transform macros
- IC_BTransform()
- IC_BTranslate()
- IC_BScale()
- IC_BScaleC()
- IC_BRotateR() Rotate Radians
- IC_BRotate() Rotate Degrees
- IC_BReorient()
- IC_BAxisRotate()
- Extraction macros
Description of the macros
The macros in this file correspond to those in
iso_csg.inc
but they return both a function
and a conventional shape.
For extracting the function or the shape from the macro return value, you need one of the following helper macros:
The CSG macros
IC_BMerge2()
Creates a merge
of two functions.
Corresponds to the IC_Merge2() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BMerge3()
Creates a merge
of three functions.
Corresponds to the IC_Merge3() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BMerge4()
Creates a merge
of four functions.
Corresponds to the IC_Merge4() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C, fn_D, ob_D:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BMerge5()
Creates a merge
of five functions.
Corresponds to the IC_Merge5() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C, fn_D, ob_D, fn_E, ob_E:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BMerge_Array()
Creates a merge
of an array of functions.
Corresponds to the IC_Merge_Array() macro from
iso_csg.inc
.
parameters:
Array, Common_Container:
Array:
array of user defined functionsCommon_Container:
common container object
IC_BIntersection2()
Creates an intersection
of two functions.
Corresponds to the IC_Intersection2() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BIntersection3()
Creates an intersection
of three functions.
Corresponds to the IC_Intersection3() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BIntersection4()
Creates an intersection
of four functions.
Corresponds to the IC_Intersection4() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C, fn_D, ob_D:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BIntersection5()
Creates an intersection
of five functions.
Corresponds to the IC_Intersection5() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C, fn_D, ob_D, fn_E, ob_E:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BIntersection_Array()
Creates an intersection
of an array of functions.
Corresponds to the IC_Intersection_Array() macro from
iso_csg.inc
.
parameters:
Array, Common_Container:
Array:
array of user defined functionsCommon_Container:
common container object
IC_BDifference2()
Creates an difference
of two functions.
Corresponds to the IC_Difference2() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BDifference3()
Creates an difference
of two functions.
Corresponds to the IC_Difference3() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BDifference4()
Creates an difference
of two functions.
Corresponds to the IC_Difference4() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C, fn_D, ob_D:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BDifference5()
Creates an difference
of two functions.
Corresponds to the IC_Difference5() macro from
iso_csg.inc
.
parameters:
fn_A, ob_A, fn_B, ob_B, fn_C, ob_C, fn_D, ob_D, fn_E, ob_E:
fn_X:
function representation of shape Xob_X:
object representation of shape X
IC_BDifference_Array()
Creates a difference
of an array of functions.
Corresponds to the IC_Difference_Array() macro from
iso_csg.inc
.
parameters:
Array, Common_Container:
Array:
array of user defined functionsCommon_Container:
common container object
IC_BInverse()
Inverts a function.
Corresponds to the IC_Inverse() macro from
iso_csg.inc
.
parameters:
Fn:
function representation of shapeOb:
object representation of shape
The shape macros
IC_BPlane()
Creates a plane
shape in form of an isosurface function.
Corresponds to the IC_Plane() macro from
iso_csg.inc
.
IC_BSphere()
Creates a sphere
shape in form of an isosurface function.
Corresponds to the IC_Sphere() macro from
iso_csg.inc
.
IC_BBox()
Creates a box
shape in form of an isosurface function.
Corresponds to the IC_Box() macro from
iso_csg.inc
.
IC_BTorus()
Creates a torus
shape in form of an isosurface function.
Corresponds to the IC_Torus() macro from
iso_csg.inc
.
IC_BCylinder()
Creates a cylinder
shape in form of an isosurface function.
Corresponds to the IC_Cylinder() macro from
iso_csg.inc
.
IC_BCylinder_Hole()
Creates a cylinder
shape with hole in form of an isosurface function.
Corresponds to the IC_Cylinder_Hole() macro from
iso_csg.inc
.
IC_BCone()
Creates a cone
shape in form of an isosurface function.
Corresponds to the IC_Cone() macro from
iso_csg.inc
.
IC_BSuperellipsoid()
Creates a superellipsoid
shape in form of an isosurface function.
Corresponds to the IC_Superellipsoid() macro from
iso_csg.inc
.
The transform macros
IC_BSor()
Creates a sor
shape in form of an isosurface function.
Corresponds to the IC_Sor() macro from
iso_csg.inc
.
IC_BRound_Box()
Creates a rounded box shape in form of an isosurface function.
Corresponds to the IC_Round_Box() macro from
iso_csg.inc
.
IC_BTriangle()
Creates a triangle shape in form of an isosurface function.
Corresponds to the IC_Triangle() macro from
iso_csg.inc
.
The transform macros
IC_BTransform()
Transforms a given isosurface function with a transform
and returns the resulting function.
Corresponds to the IC_Transform() macro from
iso_csg.inc
.
IC_BTranslate()
Translates a given isosurface function by a vector and returns the resulting function.
Corresponds to the IC_Translate() macro from
iso_csg.inc
.
IC_BScale()
Scales a given isosurface function by a vector and returns the resulting function.
Corresponds to the IC_Scale() macro from
iso_csg.inc
.
IC_BScaleC()
Range corrected version of the scale macro.
With asymmetric scaling the values are corrected with the mean of the scale vector.
Corresponds to the IC_ScaleC() macro from
iso_csg.inc
.
IC_BRotateR()
Rotates a given isosurface function and returns the resulting function.
Angles given in radians.
Corresponds to the IC_RotateR() macro from
iso_csg.inc
.
IC_BRotate()
Rotates a given isosurface function and returns the resulting function.
Angles given in degrees.
Corresponds to the IC_Rotate() macro from
iso_csg.inc
.
IC_BReorient()
Applies a Reorient()
transform to a given isosurface function.
Corresponds to the IC_Reorient() macro from
iso_csg.inc
.
IC_BAxisRotate()
Applies a AxisRotate()
transform to a given isosurface function.
Corresponds to the IC_AxisRotate() macro from
iso_csg.inc
.
Extraction macros
IC_Extents()
Extracts the function from a iso_bcsg.inc
macro
return value. The extents of the object representation are written to the
global variables IC_Min
and IC_Max
.
parameters:
Fn:
function representation of shapeOb:
object representation of shape
example:
#declare fn_1=
IC_Extents (
IC_BCone (<0,0,0>, 0, <0,1,0>, 0.5)
)
isosurface {
function {
fn_1 (x, y, z)
}
contained_by {
box { IC_Min, IC_Max }
}
}
IC_Container()
Calculates a container box from the extents of the object representation.
parameters:
Fn:
function representation of shapeOb:
object representation of shape
example:
isosurface {
function { ... }
contained_by {
IC_Container (
IC_BCone (<0,0,0>, 0, <0,1,0>, 0.5)
)
}
}