I am trying to check if the point is inside the grid using grasshopper. My approach is to draw a line between the point and the grid to find out the closest one but this approach will have a problem that the point might not be inside that grid, as shown in the below figure.
May I have your suggestions on this problem?
I would like to ask a follow-up question, is there any possible method to assign each grid a customized value? My idea is to assign value to the center point of the grid, but is it possible to do it in grasshopper? (Elefront is good but it is required to bake the geometry first, wondering if there are any other approaches.)
The least restricted and easiest to change method would be to place a Text Dot into every square in Rhino. That way you can just move the dots around with the mouse.
Create a multiline text panel with the 25 numbers you wish. Then use the area component to get the 25 centroids of the grids (25 grids, 25 centroids). Then use text tag to visualize the 25 numbers at the location of the 25 centroids.
If you know which of the 25 grids you want to select, let’s say grid 17, then you also know the number that corresponds to it. That is true if you have your 25 grids aligned with the 25 numbersexample_simple.gh (8.6 KB)
Seems that it has to bake it first then enter the value in Rhino rather than Grasshopper, then read it in Grasshopper again for following process. Otherwise, will need to maintain the data carefully in grasshopper for processing