Part of JHS PowerBar (highly recommended BTW, and it’s free), this is a very useful extension that drops objects until they intersect another object.
When it works.
Which is about 80% of the time.
Other times, instead of dropping the item, it draws a dotted vertical line along the line it SHOULD HAVE dropped the item. Screenshot attached - the yellow bar should have dropped straight down.
There are no obstructions or hidden geometry.
Any idea why it’s doing this, or any alternatives that you know about, which can “activate gravity” on a specific item and drop it down?
Sometimes, when the raycast doesn’t hit under the entire footprint of the thing to be dropped, the drop doesn’t happen. For example, if you wanted to drop a number of components on to a terrain, if there were no terrain below some of the components, those ones wouldn’t drop (because they would drop ‘forever’).
Would your example drop if you created a plane entirely below it?
Oh, I see, that makes sense. Yeah, in this example, the raycast would only “shade in” the intersection between the Yellow Bar and the deck railing, but otherwise it would fall into infinity.
■■■■, I thought it would be more logical to have it coded as “if ANY part of the Dropped Object intersects any other part of any other object below, drop it until the collision”, i.e. you don’t have to have the ENTIRE raycast shaded in, only enough of something to stop the fall (like the railing).
I can’t see if the dashed line is hitting anything. It may be looking down from the center of the bottom face. You could test if it works when that hits.
Unfortunately, the SketchUp APIs do not include any collision detection features.
Attempting to code it on our own has proven not trivial and extremely difficult.
I’ve heard that - not the easiest code base to work with, and a weird mix of some really smart and some really dumb features.
Which leads to strange situations where extensions from like 2016 still work perfectly (like 1001bit toolbar and TIG’s Roof), and some brand-new ones have major issues.
I wish there was a way to get a bunch of programmers together and update a bunch of the older extensions, then compile them into configurable toolbars / palettes…
It is the responsibility of each developer to keep their extensions updated to work with newer versions of Ruby as SketchUp adopts them. Then also, some extension authors protect their IP by encrypting the code, so the community cannot even see the code to correct. And I haven’t even gotten into possible copyright issues.
Likely because the authors are experienced and follow best coding practices.
Even a minor change in Ruby, such as the sunsetting and removal of a particular method alias can cause a breaking issue in an extension (which for the extension is a major issue.)
Extension authors need to be diligent about what Ruby changes are scheduled and avoid coding so that their code will break, if possible. (Example - The breaking of extensions using the File.exists? method alias in Ruby 3.2 with SU2024, which was listed as obsolete over 15 years ago in the Ruby 1.8.6 documentation. I remember a disagreement over at SketchUcation where I advocated to not use it and one of the prolific extension coders stubbornly refused to use the singular method name saying the plural alias was still valid and sounded better … that they were going to continue to use it. Well, it finally broke when the Ruby core project eventually removed the plural alias. My point being that it was always possible to avoid this pitfall by reading the Ruby documentation more carefully.)
Sometimes, it is not possible to avoid breakage when basic syntax changes and the extension code must be updated to straddle both the old and new code syntax scenarios.
But in this case, we are talking about an old extension by Rick Wilson and Smustard which is no longer “active.” (The authors have moved on to other life experiences. However, some of the code has explicit copyright statements.)
We also have changes to SketchUp itself which sometimes breaks its API, so we have unavoidable broken extensions until SketchUp itself is fixed in a later release.
What I’m getting at is … often there are no easy solutions.