VOXELIZE(nged)

Takes as input a primitive or a collection of primitives, old_obj, and creates a region new_obj which is the collection of voxels(RPPs) approximating the old_obj.

πŸ“… published 7.44.0, from nixpkgs unstable

✨ VOXELIZE (nged) ✨

okay so this is a BRL-CAD User Commands page, bestie, and it's about voxelize β€” the glow-up your geometry gets when you turn it into a pile of lil boxes πŸŽ€


🌸 NAME 🌸

voxelize β€” takes a primitive or a whole collection of primitives (that's old_obj, hii πŸ‘‹) and builds you a region called new_obj which is literally the collection of voxels (RPPs) that approximates old_obj. it's giving "sculpture made of legos" energy fr fr πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

voxelize [[-d] | {n}] [[-s] | {"%s %s %s"}] [[-t] | {f}] {new_obj old_obj} [old_obj1 old_obj2 ...]

yes the brackets are doing a lot, i know. breathe. it's fine. 🫢


πŸ’– DESCRIPTION πŸ’–

So. You hand it a primitive or a collection of primitives, old_obj, and it hands you back a region new_obj made of voxels (RPPs) that approximates old_obj. that's the whole vibe. ✨

  • -d β€” sets the level of detail (like, the precision of the approximation of the volume, how hard it tries). default is 1. if you give it an argument of n, then n * n rays get shot through each row, and it approximates the filled volume in each voxel region by averaging those n * n values. more rays, more accurate, more time, iykyk πŸ”₯
  • -s β€” lets you set the voxel size in each direction. default is 1, 1, 1 in whatever your current units are.
  • -t β€” sets the threshold volume that decides whether a voxel makes it into the voxelized output. default is .5. and it should always be a value between 0 and 1, no exceptions πŸ‘‘
⚠️ bestie. listen. setting the voxel size too small can increase the filesize exponentially. i'm not joking around, this is a real warning in the original and i'm passing it straight to you. tiny voxels = massive file. πŸ’€

πŸŽ€ EXAMPLES πŸŽ€

Here's the whole thing in action β€” making a voxelized version of an existing object (old_object) and naming the output (new_object).

⭐ Example 1. Create a voxelized version of an existing primitive or collection.

mged> voxelize -d 2 -s "100 100 100" -t 0.3 newregion.r oldregion.r

and here's what each lil piece is doing:

  • it creates a voxelized region corresponding to the original region oldregion.r. ✨
  • the region newregion.r consists of the resulting voxels. that's your output, that's the moment, main character energy πŸ‘‘
  • -d 2 means that on each voxel row, 2*2 (= 4) rays are uniformly shot over the area, and an approximation of the volume is reached from the raytrace data of those four rays. teamwork makes the dream work 🌈
  • -s "100 100 100" sets the size of the voxels to 100 current units in each dimension. and again β€” setting the voxel size too small can increase the filesize exponentially πŸ”₯
  • -t 0.3 means a voxel region counts as "filled" if the approximated volume of oldregion.r filling that voxel region is 30% of its total volume. so, like, a third-full counts as full. slay πŸ’…

πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team β€” legends, honestly 🫢


πŸ“ BUG REPORTS πŸ“

Found a bug or a problem? don't suffer in silence, bestie β€” email it to devs@brlcad.org πŸ˜­πŸ’Œ


okay that's the whole page! brought to you by the BRL-CAD gang β€” this is the VOXELIZE(nged) manual, mwah, go forth and voxelize responsibly πŸ§šπŸ’œ

πŸ“¦ where this page comes from