User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:10_rgg_addition:04_operator_overload:volumes

Table of Contents

Volumes

The operator and is overloaded for all de.grogra.vecmath.geom.Volume.

And

  • Volume & Volume compute the intersection volume of the two.
  • Line & Volume compute the intersection between the line and the volume

Or

  • Volume | Volume creates a CSGUnion object that holds both volumes.

This operator can be used with all classes that extends VolumeBase.

In

  • Tuple3d in Volume return true if the 3d coordinate as global are in the volume.

com

  • ~volume creates a complementary version of the volume. (inverted)

sub

  • volume - volume creates the difference between the first volume and the second one. Meaning that the new volume covers all space that is in the first one but not in the second one.

example:

// import other compiled files (.rgg, .java, .xl) without subdirectory path.
import parameters.*;
import de.grogra.vecmath.geom.Volume;
module A(float len) extends Sphere(0.5)
{
	{setShader(GREEN);}
}
 
protected void init ()
[
	Axiom ==> F(1,.2) A(parameters.length);
]
 
public void run ()
{
	Volume v = volume(first((*A*)));
	v= v&volume(first((*F*)));
	Point3d p = new Point3d(0,0,0);
	println(p in v);
	println(p in ~v);
}
01_user_documentation/07_rgg_xl/02_xl/10_rgg_addition/04_operator_overload/volumes.txt ยท Last modified: 2026/03/27 17:30 by Tim