CSG notation (InstanceTopic, 3)

From Hi.gher. Space

Revision as of 21:11, 8 February 2014 by Hayate (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

[ System created by Keiji ]

Constructive Solid Geometry Notation is a way to represent any n-dimensional object. You start with a point, and perform each operation in order.

Important: CSG notation has been obsoleted by SSC notation.


These operations create the object.

  • E = Extrudes the object.
  • H = Does the same as E, but doesn't solidify the object. Obsolete, usage of C is preferred.
  • L = Lathes the object.
  • Q = Equivalent to Mx[1]L, which effectively makes the object into a torus.
  • T = Tapers the object to a point such that the new lines are the same length as the original lines.
  • D = Tapers the object to two opposite points such that the new angles are 90 degrees.
  • Cd = Gets the convex hull of the shape in d-space.
  • Xd[v,a] = Truncates the d-hypercells by v ∈ [0,1] default 0.5 at angle a ∈ (-1,1) default 0.
  • P[a] = Projects all existing vertices onto a hypersphere of radius a ∈ (0,∞) default 1 in the dimension of the current bounding space.

These operations translate the object. A single operation for a matrix translation is being considered.

  • Md[v] = Translates the object by v in dimension d.
  • Rp[a] = Rotates the object by a in plane p.
  • Sd[v] = Stretches the object by scale factor v in dimension d.

These operations deal with groups of operations, and will separate groups if they are not explicitly defined with parentheses.

  • * = Gets the cartesian product of the two groups.
  • # = Spherates the two groups.
  • & = Intersects the two groups.
  • + = Merges the two groups.
  • - = Subtracts the group on the right from the group on the left.
  • ( ) = Makes the contained groups into one group, so that subsequent operations apply to the whole contents.

Angle notation

For use with the X operation.

  • Angles are written within angle brackets < > and are separated with commas.
  • Angles may be written in four different forms:
    • a b where a/b is the fraction of degrees out of 360, for example 90° = 1 4.
    • v where v is the pairing of a and b above.
    • x° where x is the number of degrees.
    • Anything that isn't a literal will be treated as a number of radians, e.g. 2π or tan-1(2-1).
  • Zero degrees or radians means that the angle is half-way between one affected hypercell and another.
  • They are ordered in the same order that dimensions are created using E, L, T and D operations. Normal order is xyzwφσ, followed by unnamed dimensions, but to explicitly specify you can place a series of lowercase letters at the start of the string e.g. wxyzLLL.

Plane notation

For use with the R operation.

  • Planes can be specified in two forms:
    • Provide two letters, eg. xw. This is shorter, but only gives cardinal planes.
    • Provide three points, eg. <0,0,0>,<1,0,0>,<0,0,1>. As long as the three points are not in the same line, this will give a plane that can be in any orientation.
  • Note that in the R notation, the rotation happens around the hyperaxis that is perpendicular to the plane specified.


Examples of the C operation:

  • EDDC0 produces a nullframe octahedron. This is the same as xH+yH+zH.
  • EDDC1 produces a monoframe octahedron. This is the same as xyHD+xzHD+yzHD.
  • EDDC2 produces a diframe octahedron. This is the same as HDD.
  • EDDC3 produces a triframe octahedron. This is the same as EDD.

Examples of the X operation:

  • EEEX1[<0>,2-1] - gives the octahedron. This is the same as EDD.
  • EEEX1[<0>,(2+sqrt(2))-1] - gives the rhombicuboctahedron.
  • EEEX0[<0, 0>,(2+sqrt(2))-1] - gives the truncated cube.