CLIP(1gv)
π CLIP(1gv) π
okay bestie, buckle up β this is the manual page for clip, from the 1gv section of the manual. it's giving "tiny utility, huge main character energy" and honestly? obsessed. β¨
πΈ NAME πΈ
clip β clip an OOGL object against planes or other surfaces π¦
β¨ SYNOPSIS β¨
clip [-v axisx,y,z,...]
[-g value-or-point] [-l value-or-point]
[-s nstrips[,fraction]] [-e]
[-sph centerx,y,z,...] [-cyl centerx,y,z,...]
[ooglfile]
π DESCRIPTION π
So <pink>clip</pink> β which was adapted from Daeron Meyer's ginsu module, no cap β lets you clip an OOGL object against planes, spheres, or cylinders straight from the UNIX command line. literally. its input can come from a file or from standard input, and the output goes to standard output. iykyk. π
The options specify a function of space position. The output is the portion of the object where the function is greater or less than some given value, or the portion lying between two values. Alternatively, an object can be sliced into equally-spaced strips. Objects may be of any dimension (but fr fr, check the BUGS section, bestie π).
Options are:
-gvalue-or-point-lvalue-or-point β Select the portion of the object where the function is greater than (-g) or less than (-l) the given value. If both are specified, the result is the portion of the object satisfying both conditions. π
If, rather than a single number, the argument to -l or -g is a point (a series of x,y,z,... values separated by commas, with no embedded blanks β this part matters, bestie), then the clipping surface is one chosen to pass through that point. π
-vaxisx,y,z,... β Specifies a direction in space. For planar clipping (the default), it's the plane normal direction; the clipping function is the inner product between the direction vector and the point on the object. For cylindrical clipping,-vspecifies the direction of the cylinder's axis; the clipping function is the distance from the axis. π¦-sphcenterx,y,z,... β Clip against spheres centered on x,y,z,.... The clipping function is the distance from the given center. Coordinates must be separated by commas without intervening spaces. (yes, again. the spaces are the enemy here π)-cylcenterx,y,z,... β Clip against cylinders with an axis passing through centerx,y,z,..., with axis direction given by the-voption. The clipping function is the distance from the axis. π«-snslices[,fraction] β Clip an object into a series of nslices ribbons spanning its entire extent β that's the range of function-values over the object. Part of each ribbon is omitted; the fraction, default.5, sets the width of the visible part of a ribbon compared to the ribbon period. There are a total of(nslices+fraction-1)ribbon periods across the object, so e.g.-s 2,.5slices the object into equal thirds, omitting the middle third. The output OOGL object is a LIST of OFFs, one per ribbon. π-eβ Don't emit a clipped OOGL object, just print two numbers, listing the minimum and maximum function values for the object. If-gor-lclipping options are specified, the object is clipped before determining the function range. If none of the object remains,clipprints"0 0". π
π EXAMPLES π
To extract the portion of an object lying below the x+y+z=1 plane:
clip -l 1 -v 1,1,1 file.oogl > portion.oogl
To extract the portion of an object lying in the positive octant and below the x+y+z=1 plane, we can pipe multiple instances of clip together to find the intersection of several half-spaces:
clip -g 0 -v 1,0,0 file.oogl | \
clip -g 0 -v 0,1,0 | \
clip -g 0 -v 0,0,1 | \
clip -l 1 -v 1,1,1 > portion.oogl
To find the region lying between two surfaces (either above one and below the other, or below the first and above the second), say the planes 2x + y -.5z = 1 and y + 2z = 0:
echo "{ LIST"
clip -v 2,1,-.5 -g 1 file.oogl | clip -v 0,1,2 -l 0
clip -v 2,1,-.5 -l 1 file.oogl | clip -v 0,1,2 -g 0
echo "}"
We use pipelines to compute intersections, and a LIST to form their union. π«Ά
π SEE ALSO π
ginsu(1)
π BUGS π
Uses anytooff(1) to convert input data to OFF format internally; this can lose information. π The only arbitrary-dimensional form accepted at present is nOFF, not nSKEL or nMESH. However the four-dimensional 4OFF, 4QUAD, 4MESH, 4VECT, etc. formats should work.
clip really only clips edges. If a curved clipping surface cuts an edge twice, or removes only an interior portion of some polygon, clip misses it entirely. Clipping against a curved surface yields a straight edge (a chord of the ideal curved edge segment). This latter failing might be fixed someday. π
not me warning you about curved surfaces missing edges β bestie, that's just the tea, and the tea is undiluted. π΅
that's the whole page, bestie! this one's from the Geometry Center, dated 23 November 1994 β vintage, iconic, still slaying. πβ¨ππ¦πΈπ
π¦ where this page comes from
- debian bookworm: geomview 1.9.5-4+b1
- debian trixie: geomview 1.9.5-5
- fedora 43: geomview 1.9.5-33.20190630git1d6759e.fc43 Β· LGPL-2.0-or-later AND GPL-2.0-or-later
- fedora 44: geomview 1.9.5-35.20190630git1d6759e.fc44 Β· LGPL-2.0-or-later AND GPL-2.0-or-later
- ubuntu jammy: geomview 1.9.5-3build1
- ubuntu noble: geomview 1.9.5-4.1build2
- ubuntu questing: geomview 1.9.5-6
- ubuntu resolute: geomview 1.9.5-6build1
- ubuntu stonking: geomview 1.9.5-6build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms