Grasshopper Python - IsPointInside problem

EDIT: IsPointInside does not work, but it should. Do you know why it might be not working?
“I’m trying to script ‘IsPointInside,’ but it’s not working, what am I doing wrong?”

Thanks in advance for your response.

20180915 00 problem inside brep.gh (9.4 KB)

obst = rg.Box.ToBrep(obst)

Dude, your arrogance is way too much.

I did not intend to sound arrogant, sorry for that. Please do not misinterpretate my misinterpretateable sentences. English is not my native language.

Another thing. I cannot solve one other problem. Somehow Python reads an item as a list. This is of course because ‘I am’ the one who does not know how to do it ‘correctly.’ However, do you know what ‘my’ mistake could be?

20180915 01 problem inside brep.gh (9.6 KB)

Neither is mine, but asking for help would assume a little modesty.

instead of:
“This doesn’t work, but it should!”
It could be:
“I’m trying to do this, but it’s not working, what am I doing wrong?”

The first one will make people skip your thread. The second will trigger empathy in people and they will invest time to help you.

Have in mind that most of the people in this forum are not McNeel employees, they are not paid to help anyone.

I changed the code a bit and this is my error: (:slight_smile: mainly because I don’t know how to use enumerate())
image

Apparently you cannot use IsPointInside with planes.

1 Like

Hi PEYCHEV
I hope this help you

You can see this link about the enumerate function.13. Enumerate — Python Tips 0.1 documentation.

1 Like

So, could it be, the brep I created with

obst = rg.Box.ToBrep(obst)

is a planeBox instead of a brep?

Ah, magic!

inside = obst.IsPointInside(p, 0.01, True)

It was the ‘p’ I forget to fill in, thank you.
Also,

inside = obst.ToBrep().IsPointInside(p, 0.01, True)

I did not know obst.ToBrep(). was possible as like placing it before another one. Thank you for your response.

This is my gh file.
20180915 00 problem inside brep .gh (7.2 KB)

The IsPointInside() method belongs to the Brep instance.So you need to convert the box instance to a brep instance first.

1 Like

Thanks but unless I find a reason I won’t invest time in learning enumerate()

Even here you can do without it:
image

1 Like

yes ,You can not use the enumerate() function here.Because you only need to loop through every value in the list,You don’t need index and value at the same time,So you only need to write “for point in x:obst.ToBrep().IsPointInside(point, 0.01, True)”

1 Like