Get objects at specified poitn
-
Is there any way to get all the objects at a specific point in 3d space, other than model.raytest? In this case, I know the exact 3d coordinate.
Thanks,
--
Karen -
each entity with a vertex at that point, or also edges and planes that cross the point?
-
I think just vertices would be ok, but some of them are nested components, and I'm trying to avoid running through all components to create a database... having raytest return hidden entities is really messing me up!
Not sure if there's a way to do it with a view and pickhelper, or something like that... I'm not so familiar with those methods.
-
Just wait for the SketchUp maintenance release. It is going to fix the raytest so it does not fail anymmore, and so that it does not stop on hidden entities anymore.
-
If you use raytest you can recast the ray when you hit hidden entities.
But if you can use the pickhelper, then that would be the best one.
ph = view.pick_helper ph.do_pick(x,y) # Iterate all the possible pick paths (note that the same entity might appear in multiple paths) (0...ph.count).each { |i| for e in ph.path_at(i) # ... end }
-
-
The benefit of the pickhelper is that you don't have to worry about the raytest issues.
(and it's the most appropriate method to get the entities for a given mouse position) -
Chris,
you made my day, I'll stop worrying about it then.
Thanks!
--
Karen -
http://groups.google.com/group/sketchupruby/browse_thread/thread/79b9dab46dd374c0
Read that thread. Tyler Miller said they got the raycast bug fixed where it is not stable. Then I nentioned this hidden issue (thanks to Karen for bringing it up). He confrimed it will be fixed as well. It was all part of the same bug.
Chris
-
Rightio! When is the service release coming then...! eh? eh?
-
Good question, hopefully soon.
Now we'll have to add a version check to make sure people are not running SU 8, original release. But that's ok, the fix will be well recieved.
Advertisement