Hello, I need help on how to solve the problem. I have a 3d mesh and a series of points inside of it (static). I need to populate the whole mesh with other points with minimum and maximum distance parameters that each point can be. It is necessary that the whole of the mesh is filled by respecting these parameters.
The fastest (almost real time) way to do this is to use RTrees (min/maxR) for checking the validity of a given (rnd) candidate pt VS the existed collection (where existed - via an user option - could mean (a) your fixed Pts (b) your fixed Pts + the new ones).
Rather elementary via code … but I have no idea how to do it with components.
All that assuming that the Mesh.IsPointInside (pt, tol, inside) Method works (not a given).
Most of the time maximum distance is used in the “dart throwing method” and is relative to a specific point. Points are thrown between min and max distance.
I am not sure it has a meaning in your question, except if your geometry has a diameter less than this maximum distance. Some drawing could be useful. But as said by @PeterFotiadis c# or Python with Rtree will be useful.
But if you want a simplier way use Populate 3d and put preexisting points in the last input parameter. Then play on the number of points in order to have a minimum distance acceptable by you. This component under the hood is doing some dart throwing. So for a specific N Count all points will have a distance > to a threshold (unknown but that could be measured). You could approximate this distance by using the volume of the box and the number of points.
When happy with the result then use
Well … I have LOT’S of similar things (for rnd trusses, rnd spaces, rnd dogs, rnd cats etc etc). So I did a few mods for a C# that does that … and guess what? a Point3dList based search (Note: for each candidate (rnd) pt we test only 2 pts: the prox (where d should be > min) and the next prox (where d should be < max)) is faster than a RTree (because we sample all existed pts where d < max and then we test each one if d > min). Small differences - obviously - but every millisecond matters.
To more precise. My goal is the generate new target for increase a static population of a area ( the mesh)
I have already some drillhole who pass by the mesh. (the existing point population)
The radius of sphere, is the maximum impact I can use the data for ma spatial static. So I need to fill the mesh has is possible with sphere with the same radius but I can allow a tolerance ( min and max distance)
Also good to know,
the sphere the range of the radius can be 12.5 to 25 m, depend the case
but the width of the mesh is only 3 to 15m but mostly 3m.
I.e. foreach random candidate Pt (inside the Mesh) get the prox and the next prox. If dist to prox (red) >= min and dist to next prox (white) <= max … that’s a valid Pt.
Is this what you are after? If no … what EXACTLY dist condition are you looking for?
Sorry … but I can’t understand an iota - opposite to what? Maybe with regard the if clause used : proxDist >= min && nextProxDist <= max. Meaning that you want: proxDist < min && nextProxDist > max ??? (this yields a disc containing the prox and the nextProx pts).
And what have to do the M dims with all that? I assume that you are talking BBoxes Lengths > If they are not “compatible” with your min/max values … you just get null new points,
Anyway: as I said: state EXPLICITLY the dist rule (or rules) for validating the candidate point (given the start-up pts collection + the valid [accepted] ones).
PS: currently for, say, ~400 start up pts and ~400 new pts the Elapsed is circa 10 ms (more or less OK) using my classic crap I5 (I always use the slowest CPU around when writing new code). But if you have in mind 1+B pts … well … that requires a different strategy.