The user may want to define Rules for existing Modules by assembling them into an example aggregate (or more of them).
Main architecture
From inputs: well-defined Modules and a bunch of geometry,
the detector will identify the Modules distributed in space and generate deterministic Slots.
In part 2/2 of this Issue the Envelope of deterministic Slots will be scanned for adjacencies and respective Rules will be created.
Issues
In Grasshopper / Rhino there are no easy-to-use references to geometry, therefore the component will have to detect and identify which geometry represents which Module.
Modules with no geometry (i.e. Empty) will be skipped
Issue with indifference and out-Module (see Part 2/2)
Pseudocode
Skip empty Modules
Modules have a Pivot = a plane in the center of the first Module Part. For conventional Modules this means that the Pivot is close to some Module geometry, but this is not guaranteed, as the geometry can be outside the Module cage. Therefore we need to find the longest of closest distances between the geometry and its Pivot = l_max.
Wrap the example geometry into a bounding box and populate it with Slot centers (grid origin and orientation defined by a Base plane).
Grow the Slot centers by l_max \ slot_diagonal_min_coordinate layers
One-by-one copy each Module geometry (use Pivot) onto each Slot center and check if all Module Geometries overlap (are identical) with some example geometry. Optimize by checking bounding boxes first.
If perfect match (consider what to do if there is more example geometry - probably nothing because Module geometries may legally overlap), then place a deterministic Slot (containing the firs Module Part) onto the Pivot and onto all adjacent Slot centers occupied by other Module Parts
Purpose
The user may want to define Rules for existing Modules by assembling them into an example aggregate (or more of them).
Main architecture
From inputs: well-defined Modules and a bunch of geometry, the detector will identify the Modules distributed in space and generate deterministic Slots. In part 2/2 of this Issue the Envelope of deterministic Slots will be scanned for adjacencies and respective Rules will be created.
Issues
Pseudocode
Pivot
= a plane in the center of the first Module Part. For conventional Modules this means that the Pivot is close to some Module geometry, but this is not guaranteed, as the geometry can be outside the Module cage. Therefore we need to find the longest of closest distances between the geometry and its Pivot =l_max
.l_max \ slot_diagonal_min_coordinate
layers