SPHGROUP(nged)
create a group of all regions whose centers fall inside a sphere
SPHGROUP(nged) β BRL-CAD User Commands β okay bestie, let's go. π
β¨ NAME β¨
SPHGROUP(nged) gives you sphgroup β create a group of all regions whose centers fall inside a sphere. No cap, it's giving spatial-search-but-make-it-a-combination energy. π
πΈ SYNOPSIS πΈ
sphgroup gname target_sphere.s
π DESCRIPTION π
okay so sphgroup creates a new combination called gname, and that combination contains all the regions in the database whose bounding-box center point lies within the bounding sphere defined by target_sphere.s. The sphere argument has to be an existing ELL or SPH primitive in the database, periodt.
Here's the tea on how it picks who gets in:
- It scans all regions in the database β that means objects flagged as regions β and computes each region's axis-aligned bounding box. π¦
- A region is included in
gnameif the center of its bounding box is within or on the surface oftarget_sphere.sβ specifically, if the distance from the bounding-box center to the sphere's center vertex is less than or equal to the sphere's radius. β - Non-region objects, hidden objects, and the sphere primitive itself are skipped. π
All qualifying regions are added to gname as union (u) members with no item ID or air code set. If gname does not already exist, it is created; if it does exist, the new members are appended to it. π«Ά
Note, bestie: the containment test uses the center of each region's bounding box, not all eight corners. A region whose center is outside the sphere is excluded even if part of its geometry overlaps the sphere. So yes, overlap alone does not save it β that's the documented behavior. π
π₯ EXAMPLES π₯
Example 1. Group all regions centered inside a sphere primitive
mged> sphgroup cluster.c search_sphere.s
This creates the combination cluster.c containing all regions whose bounding-box centers lie within the sphere primitive search_sphere.s. The sphere search_sphere.s must already exist in the database and must be an ELL or SPH primitive. π
Example 2. First create the bounding sphere, then group
The page wraps this one in a lowkey cursed spot, so here's the exact text:
mged> make search_sphere.s sph mged> sphgroup nearby.c
search_sphere.s
This creates a unit sphere at the origin with make, then groups all regions centered within it into nearby.c. π
π AUTHOR π
BRL-CAD Team β iconic. π
π BUG REPORTS π
If you find bugs or problems, the page says to report them via electronic mail to devs@brlcad.org. fr fr, tell the devs. π
Cute footer sign-off: BRL-CAD made this page, the title is SPHGROUP(nged), and the footer did not give us a date β so no date invented here, bestie. π
π«Ά
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms