I’m new on the forum, and I’m a new Grashopper user. I would like to develop an algorithm that allows me to “trap” a complex surface with a regular base module (for example a rhomboid module). I do not know where to start, can someone help me
You mean that you want to replace classic Box voxels (as shown) with any module?
If yes I would suggest: to replace your Brep with a Mesh (inclusion [or proximity] on meshes is way faster: for instance in this case captured if a blob is used - instead of a mesh - then the Elapsed time is 10++ times the time shown [on the limit for some sort of interactive design]), then create a 3d grid (with respect the given module size/topology) that could yield module centroid positions and then deploy the desired modules (if you do that using instance definitions the result could be 1000 times faster especially for big N of modules and/or “complex” modules).
For classic Box voxels the trick is very simple: get a bounding box, determine the user controlled “resolution” in x,y,z and then create a 3d Point grid (as tree) that is inside the box. Then test each point for, say, inclusion and get the final tree with the voxel centroids. That said in some cases the mesh inclusion test is not 100% perfect … but that’s irrelevant for that type of “artistic” job.