Negative scaling/mirroring
-
I was making some components today and the simplest way of doing something was to have a copy of a component mirrored. I thought I would just set lenx to a negative value and have that do it, the same as scale factor -1, but it did nothing.
It seems that the len values are always made absolute. I know that I can simply physically copy the component this time and mirror it, but I am sure that there would be times when it would be handy to have mirrored objects created on the fly.
If it is a design feature to enable people to put messy formulas in there and still get what they expect, I would prefer to make them use abs(). It could just be that the behind the scenes ruby stuff leads to this result, though.
Maybe I have missed something, or is this just the way things are?
It would also have been nice to just use =(-1^copy)*length, but I know ^ is on the todo list.
-
Personally having -ve len values doesnt make a lot of sense to me, as length is just a scalar value and so doesnt have a direction (you wouldnt use a negative length when you were woodworking, for example.)
On to your problem, you could always have 2 different components with a hidden attribute that changes with the copy.
-
This one was a point of much argument around here during the design stage. On one hand, you should be able to mirror things like SU does so nicely. On another, negative lengths don't make sense to a lot of people. So the compromise was to use all positive lengths, but to respect any "mirrored" state that was manually applied.
See the attached model. Use the Component Options window to change the width of a couple of subparts, one of which is mirrored. Note that LENX of both of them is reported in the positive, even though one is flipped.
So that's the way to do it: flip your component manually as you need, then code formulas to control its LENs.
-
@unknownuser said:
.........So the compromise was to use all positive lengths, but to respect any "mirrored" state that was manually applied........
Scott,
I've noticed that mirrored Dynamic Components are flipped back whenever there is a rotate attribute included in the Component Attributes box. It's as if in these cases SU can't / will not handle components with axes that are mirrored. They need to be: Blue up / Red to the right / Green away from us on screen. Or rotated of course. BUT NOT FLIPPED in any way. (two times flipped is considered normal!)
This has been mentioned in at least one occasion. Please see:
http://groups.google.com/group/sketchupissues/browse_frm/thread/8f8ec49297b57d14/960b50e4e20fe1e3?lnk=gst&q=wo3dan%2Bnick#960b50e4e20fe1e3Is there a correct way for SU to handle flipped components with rotations in DC attributes, better than my (miserable) workaround?
Wo3Dan
-
@wo3dan said:
Is there a correct way for SU to handle flipped components with rotations in DC attributes, better than my (miserable) workaround?
Unfortunately, no. Rotations completely reset the current transformation before applying new ones, so it destroys your flip status. This bug has been recorded for a future fix. So the only workaround is to create a new component where the geometry (or a subcomponent) is flipped.
-
@unknownuser said:
....This bug has been recorded for a future fix. So the only workaround is to create a new component where the geometry (or a subcomponent) is flipped.
Scott, others interested in flipped DC components,
(Thanks for the very quick reply!!!)
In that case it might also be worthwhile to see if an embedded flipped component will do (see my workaround: the flipped DC is at least one level down, nested in a "shield" to create correct axes.
For its geometry will be updated like normal copies of a component when changes are being made to the
original component.Whichever fits best.
Wo3Dan
-
Ah, that will be why it didn't work for me, then; I was trying to use mirroring for the ends of a strip light, which I need to be able to control the rotation of. I did just use another component in the end, but it is nice to know that that bug will be looked at.
Personally, I'm quite happy dealing with negative lengths, imaginary numbers, virtual photons and the like, but I accept I am probably not normal in that regard and most people (ie those who live in the real world) would find it very confusing. Oh well, as long as there are ways to make it do what I want
Thanks for the reply Scott.
-
Yay let's reply to a topic that is half a year old.
Ok so I was having the same problem, I wanted to make a component that would mirror when clicked on with the DCFinger. Eventually I solved it by duplicating the component, mirroring one copy, and hiding each alternately.
But it set me to thinking. Why Length? What does length matter? I don't care about length. Also, SU itself seems to calculate things not based on length, but on scale. Length is just a result. So, whereas negative Length doesn't make any sense, anyone can figure out that negative scale is the same as mirroring.
So why not use scale instead of length, Google guys? -
Pyroluna,
That's an interesting idea. I'll add a note to our issue tracker.
I definitely see scenarios where scale would be more intuitive than a length...
Thanks!
-
@unknownuser said:
@wo3dan said:
Is there a correct way for SU to handle flipped components with rotations in DC attributes, better than my (miserable) workaround?
Unfortunately, no. Rotations completely reset the current transformation before applying new ones, so it destroys your flip status. This bug has been recorded for a future fix. So the only workaround is to create a new component where the geometry (or a subcomponent) is flipped.
I have run into this quote often, its very frustrating. If I could have negative rotations, I could have much lighter models for the stuff that I am doing.
Advertisement