View Full Version : point inside 3d solid
mattko
2017-04-17, 02:19 AM
I´m trying to determine whether a point is inside a 3d solid object. That would mean that the number of intersections of a ray from that point and the 3d solid object is uneven. Can somebody help me in writing a lisp to do that?
marko_ribar
2017-04-17, 01:12 PM
You must be logged to access...
https://www.theswamp.org/index.php?topic=50107.msg552726#msg552726
HTH., M.R.
mattko
2017-04-17, 07:18 PM
Kolega hvala, but no luck, "Command: ; error: bad argument value: AcDbCurve 45"
I was thinking of doing the check the same way you did (making a section and then checking if the point is inside the region), but then thought counting the intersections of a ray with the solid would be easier (since I work with orthogonal solids and the points can not be on an edge). I will try to edit your code and make it work for me.
I also vaguely remember of an autocad function which draws the piercing points of a line and a solid (from a job I did a couple of years ago), but can't seem to find it now. :?
mattko
2017-04-17, 10:59 PM
Thinking about it some more, I think the models I was talking about in the previous post already had the piercing point drawn in (they were exported from Rhyno). Seems a bit odd Autocad doesn't have functions allowing such interactions between line and 3d solid objects.
marko_ribar
2017-04-18, 09:23 AM
Thinking about it some more, I think the models I was talking about in the previous post already had the piercing point drawn in (they were exported from Rhyno). Seems a bit odd Autocad doesn't have functions allowing such interactions between line and 3d solid objects.
If you are talking ab intersections of LINE or CURVE with 3DSOLID, then CAD have this functionality - it's only little convoluted... You have to use IMPRINT command, then select source curve and destination 3dsolid, but then in the end you have to explode 3DSOLID all the levels -> REGIONS and BODIES -> LINES, and then when exploded to the end you should see point of intersections as points... Then COPYBASE those points with base '(0 0 0) and do several UNDOs until you reach the situation before exploding, then just PASTECLIP into point '(0 0 0), and that's it you'll have curves, 3dsolids and points of intersection...
M.R.
mattko
2017-04-18, 10:10 AM
Yep, thats the one. So, no easy way to count the imprinted points, too bad. Thanks for the help!
dgorsman
2017-04-20, 07:19 PM
Thinking outside the box a bit (to see if it's actually *inside* the box :mrgreen: ) - construct a temporary, very small solid at the desired point. Then check for interference with the other solid in question. If this has to be done repeatedly, then create the point-solid once and relocate to each test point in turn.
mattko
2017-04-24, 01:20 AM
Great idea! Thanks ;)
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.