sure, but if the transform bumps you out of the SU tolerance, you're hosed.
Posts
-
RE: Test Point3d position tolerance?
-
RE: Advice on image editing - photo & render
<self-interest>
Well you could install LightUp (http://www.light-up.co.uk) that does artificial lighting + mirrors all inside SketchUp.
This is a screengrab from inside Sketchup:
</self-interest>
-
RE: Occupy Wall street
@solo said:
Lack of Democracy fuels these protests.The Wall Street crooks get away with stealing billions and our government is doing NOTHING about it, even talking about laxing regulations. The 1% elite keeps us in endless wars, unpayable debt while they are getting richer. The virtual slave labor imports and open borders helped to kill our jobs, our 401 Ks have been robbed (it was all planned) , our crooked and corrupted politicians created financial bubbles that ruined us. It looks that our politicians are not taking the protests seriously enough until there is bloodshed. Then, it may be too late.
Totally agree. One really has a sense that these guys are going to keep fobbing us off, not realizing just how much anger is brewing - and when it explodes, will be saying "who could have predicted?"!
"Let them eat Brioche" version 2.0
-
RE: WebDialog and OSX - resizeable regardless?
Nice one driven.
Just remember this is not supported by SU6, so make sure you predicate it with version_number.
Adam
-
Hidden Line Removal outputs
Hi,
Just added a quick tutorial on how to output very high resolution Hidden Line Removal images from Sketchup. (Got somebody yesterday doing 20,000 pixel wide images...
)http://www.light-up.co.uk/index.php?t=story&p=101
Adam
-
RE: .dll accessing - how to?
Guy,
Generally, you're not going to be able to do anything useful with the entrypoints its exposes. Particularly not from Ruby.
Not sure if it helps but here's a quick tutorial on output very high resolution hidden line images using LightUp..
http://www.light-up.co.uk/index.php?t=story&p=101
Adam
-
RE: Test Point3d position tolerance?
Chris,
Because of finite precision math computers use, this is a common problem.
Generally you compare positions by checking that the length of a vector between the 2 points is shorter than an epsilon of your choosing since you don't know whether errors are bumping you to -inf or +inf.
delta = pointa - pointb
if (delta.dot(delta) < 1e-4)
..same position
endThe really scary thing that many people don't realise is that the finite precision used by computer floating point means that multiply isn't always Commutative. ie you can get a different answer for ab than ba! This causes huge problems for systems that need to be able to exactly repeat a simulation etc.
-
RE: The Lion
John,
How well can you recall the inside? Now thats the question..
Adam
-
RE: Sketchup.parse_length
@unknownuser said:
If this can help, I have coded methods to parse lengths (as well as integers and floats) with or without formulas.
For the locale, I decided to accept both the dot and comma as decimal separators, so that there is no interference with the local settings.You can get some inspiration by browsing the file Lib6Traductor.rb in LIBFREDO6_Dir_xx folder. Just search for methods like:
**** Traductor.string_to_length(s)- Traductor.string_to_length_formula(s)
- Traductor.string_to_float(s)
- Traductor.string_to_float_formula(s)***
Fredo
Nice work Fredo.
However, in your string_to_length(), I don't think SketchUp supports units of "km", "feet" and "mile" (though it will accept ' and " for foot and inch respectively)
What's so frustrating about stuff like this is not that software has bugs - it all does - just that for the rest of time you have to have scripts that jump through hoops to side-step this, duck to avoid that, jump to miss that... making them a right ol mess.
I guess there is an argument here that based on version number, you do go in and overload the core Sketchup methods to fix them. Problem is that while there are a bunch of great coders that I would totally trust to do this well, there's a lot more that don't have the experience to do this right, so it would be opening a horrible can of worms. I'm looking at you, Matchbox.

Adam
-
RE: Sketchup.parse_length
This is what I'm using in LightUp
/([0-9]+[\,\.]*[0-9]*)([\w\"\']+)?$/ -
RE: Sketchup.parse_length
Playing some more, I think its a straight bug in Sketchup code. As in, without a decimal separator the behaviour is as expected..
Ultimately, I can't rely on it so I'll need to parse everything myself.. grrr..
Adam
-
RE: Sketchup.parse_length
@adamb said:
AdamB wrote:
If I have to write a Regex to parse the string to check it valid before giving it to parse_length(), then I might as well do the last step of conversion myself.You could, but you'd also have to deal with the user's locale for decimal symbol...
Absolutely! Really don't want to re-invent the wheel.
BUT.. you're getting different results to me. I don't get nil back, I get 39.3700787401575 back - which really screws stuff up.
(I've always checked for nil).I feel a witch hunt coming on.. it is almost Halloween..
Ah, just saw your new post! If it is "by design", thats an extremely poor decision.
-
Sketchup.parse_length
Is this a known bug?
I had assumed that
Sketchup.parse_length(X)doesn't accept badly formed length strings..But you can give it any old crap and it gives back a value (looks like its the metric-to-inches multiplier it uses).
` Sketchup.parse_length("1.0cm")
=> 0.393700787401575Sketchup.parse_length("1.0splishysplash")
=> 39.3700787401575`If I have to write a Regex to parse the string to check it valid before giving it to parse_length(), then I might as well do the last step of conversion myself.
Kinda brain-damaged...
Adam
-
RE: Shadow analyse on a building facade
Just to add to the list, LightUp (http://light-up.co.uk) performs realtime Solar analysis all from inside SketchUp (in the same Window).
Here's a realtime capture of it in use comparing Summer and Winter insolation.
[flash=640,480:3897kuqs]http://www.youtube.com/v/jxPyMvI_EqI[/flash:3897kuqs]
-
RE: Shadow Catcher materials
Chris, Thomthom,
Yes thats a great idea to post the luca files / models!
Just finishing off an update for the LightUp Player/Webplayers, so it will be a few days.
Adam
-
RE: Determining if a point is "in front" or "behind" a surface
@dan rathbun said:
def point_behind?( pt, face )
return nil if face.plane.nil? return false if pt.on_plane?(face.plane)
d = face.normal.dot( pt.to_a ) - face.plane[3]
d < 0 # ? true : false
end #defMust say I really don't like this kind of half-hearted defensive programming style. Why would a face not have a plane? And if you're going to test for that, test for the face being a Sketchup::Face, and if you going to test for that, then also test for pt being a Geom::Point3d... and on and on and on...
Code like this, is going to be embedded within a "hierarchy of confidence" set of functions. You don't need to be chasing your tail all the time - especially in a very slow language like Ruby.
You should have strong validation on data as it enters your system, then after that you don't litter code with meaningless tests that simply slow stuff down and reduce readability.
There, I've got that off my chest. And nothing to do with France - England match result either..

Adam
-
RE: Determining if a point is "in front" or "behind" a surface
Gents, Ruby is slow enough without doing extra work!
face.plane already gives the normal + distance along then normal for the face plane.
So just do:
d = face.normal.dot( [testX, testY, testZ] ) - face.plane[3]
puts(d > 0 ? "in front" : "behind")
-
RE: DC - hidden parts
I believe there is a fundamental bug in the .visible? method.
If you walk the hierarchy and query an entity.visible? state, it simply tells you whether it has explicitly been hidden, not whether it is visible.. very un-useful!
You would need to follow the hierarchy all the way to the top to determine if any antecedent (parent) was hidden - and thus all subsequent children are hidden - to get the correct answer.
Basically it requires you to structure code as a recursive descent.. which runs counter to the definition.instances graph-like structure.
EDIT: as I'm writing this..are you saying hidden? and visible? are actually different?
-
RE: Sunset
@nomeradona said:
very nice. how i wish you write tutorial for this and the storm/
+1 Be great to see this deconstructed to help me/us learn.
-
Shadow Catcher materials
A new tutorial on setting up and using Shadow Catcher materials available here:
http://www.light-up.co.uk/index.php?t=tips
Let me know what you think.