This module defines transforms that can be applied to each SDF: - Union - Intersection - Subtraction - Displacement - Bend - Twist - Elongate - Repeat - Extrude - Revolution - Onion
Initialise the displacement modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
procedure(primitive) | :: | func |
Function to displace the SDF with. |
Initialise the elongate modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
type(vector), | intent(in) | :: | size |
Distance to elongate by |
Initialise the extrude modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
real(kind=wp), | intent(in) | :: | h |
Distance to extrude by. |
Initialise the Onion modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
real(kind=wp), | intent(in) | :: | thickness |
Thickned to onion by. |
Initialise the Repeat modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
real(kind=wp), | intent(in) | :: | c | |||
type(vector), | intent(in) | :: | la | |||
type(vector), | intent(in) | :: | lb |
Initialise the Revolution modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
real(kind=wp), | intent(in) | :: | o |
Amount to revolve by. |
Initialise the twist modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
real, | intent(in) | :: | k |
Twist parameter. |
Bend a SDF.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public | :: | k | ||||
integer, | public | :: | layer |
Layer ID of SDF |
|||
type(opticalProp_t), | public | :: | optProps |
Optical property of the SDF |
|||
class(sdf_base), | public, | pointer | :: | prim | |||
real(kind=wp), | public | :: | transform(4,4) |
Transform to apply to SDF. |
private function bend_init (prim, k) | Initialise the Bend modifier for a SDF. |
procedure, public :: evaluate => eval_bend |
Displace the surface of a SDF by a function.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
procedure(primitive), | public, | nopass, pointer | :: | func | |||
integer, | public | :: | layer |
Layer ID of SDF |
|||
type(opticalProp_t), | public | :: | optProps |
Optical property of the SDF |
|||
class(sdf_base), | public, | pointer | :: | prim | |||
real(kind=wp), | public | :: | transform(4,4) |
Transform to apply to SDF. |
private function displacement_init (prim, func) | Initialise the displacement modifier for a SDF. |
procedure, public :: evaluate => eval_disp |
Elongate a SDF
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | layer |
Layer ID of SDF |
|||
type(opticalProp_t), | public | :: | optProps |
Optical property of the SDF |
|||
class(sdf_base), | public, | pointer | :: | prim | |||
type(vector), | public | :: | size | ||||
real(kind=wp), | public | :: | transform(4,4) |
Transform to apply to SDF. |
private function elongate_init (prim, size) | Initialise the elongate modifier for a SDF. |
procedure, public :: evaluate => eval_elongate |
Extrude a 2D SDF into 3D
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public | :: | h | ||||
integer, | public | :: | layer |
Layer ID of SDF |
|||
type(opticalProp_t), | public | :: | optProps |
Optical property of the SDF |
|||
class(sdf_base), | public, | pointer | :: | prim | |||
real(kind=wp), | public | :: | transform(4,4) |
Transform to apply to SDF. |
private function extrude_init (prim, h) | Initialise the extrude modifier for a SDF. |
procedure, public :: evaluate => eval_extrude |
Carves or gives thickness to SDFs
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | layer |
Layer ID of SDF |
|||
type(opticalProp_t), | public | :: | optProps |
Optical property of the SDF |
|||
class(sdf_base), | public, | pointer | :: | prim | |||
real(kind=wp), | public | :: | thickness | ||||
real(kind=wp), | public | :: | transform(4,4) |
Transform to apply to SDF. |
private function onion_init (prim, thickness) | Initialise the Onion modifier for a SDF. |
procedure, public :: evaluate => eval_onion |
Repeat a SDF
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public | :: | c | ||||
type(vector), | public | :: | la | ||||
integer, | public | :: | layer |
Layer ID of SDF |
|||
type(vector), | public | :: | lb | ||||
type(opticalProp_t), | public | :: | optProps |
Optical property of the SDF |
|||
class(sdf_base), | public, | pointer | :: | prim | |||
real(kind=wp), | public | :: | transform(4,4) |
Transform to apply to SDF. |
private function repeat_init (prim, c, la, lb) | Initialise the Repeat modifier for a SDF. |
procedure, public :: evaluate => eval_repeat |
Revoloution modifier. Revolves an SDF around the z axis (need to check this!!)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | layer |
Layer ID of SDF |
|||
real(kind=wp), | public | :: | o | ||||
type(opticalProp_t), | public | :: | optProps |
Optical property of the SDF |
|||
class(sdf_base), | public, | pointer | :: | prim | |||
real(kind=wp), | public | :: | transform(4,4) |
Transform to apply to SDF. |
private function revolution_init (prim, o) | Initialise the Revolution modifier for a SDF. |
procedure, public :: evaluate => eval_revolution |
Twist a SDF
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public | :: | k | ||||
integer, | public | :: | layer |
Layer ID of SDF |
|||
type(opticalProp_t), | public | :: | optProps |
Optical property of the SDF |
|||
class(sdf_base), | public, | pointer | :: | prim | |||
real(kind=wp), | public | :: | transform(4,4) |
Transform to apply to SDF. |
private function twist_init (prim, k) | Initialise the twist modifier for a SDF. |
procedure, public :: evaluate => eval_twist |
Smooth union. Joins two SDFs together smoothly
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | d1 |
SDF_1 distance |
||
real(kind=wp), | intent(in) | :: | d2 |
SDF_2 distance |
||
real(kind=wp), | intent(in) | :: | k |
smoothing factor. |
Initialise the displacement modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
procedure(primitive) | :: | func |
Function to displace the SDF with. |
Evaluation function for displacement modifier.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(displacement), | intent(in) | :: | this | |||
type(vector), | intent(in) | :: | pos |
Position to evaluate the modifier at |
Evaluation function for Revolution modifier.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(revolution), | intent(in) | :: | this | |||
type(vector), | intent(in) | :: | pos |
Position to evaluate the modifier at |
Intersection operator. Returns the intersection of two SDFs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | d1 |
SDF_1 distance |
||
real(kind=wp), | intent(in) | :: | d2 |
SDF_2 distance |
||
real(kind=wp), | intent(in) | :: | k |
smoothing factor. |
Initialise the Revolution modifier for a SDF.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf_base), | target | :: | prim |
SDF to modify |
||
real(kind=wp), | intent(in) | :: | o |
Amount to revolve by. |
Subtraction operator. Takes one SDF from another. Take the first SDF from the 2nd SDF
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | d1 |
SDF_1 distance |
||
real(kind=wp), | intent(in) | :: | d2 |
SDF_2 distance |
||
real(kind=wp), | intent(in) | :: | k |
unused factor. |
Union operation. Joins two SDFs together
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | d1 |
SDF_1 distance |
||
real(kind=wp), | intent(in) | :: | d2 |
SDF_2 distance |
||
real(kind=wp), | intent(in) | :: | k |
unused factor |