How to align all components axis to world axis
-
@iaddic said:
sdmitch. The problem is the component is generated from an app so the origin of the component is as described...I've made a local library of the components and tried placing them again but they are all rotated per their original placement. If I placed each component from the library I'd end up with the same model as the original...unless you know of a way to reset the origin I think I am still stuck.
Yes it is obvious that the components were not created on the xy plane and aligned with a single axis. So far all I have been able to do is reset the transformation so that it is at the .bounds.min and not somewhere in never never land.
I'll work on this problem some more tomorrow to see if I can't get them on the xy plane.
-
sdmitch, I have discovered you are quite the sketchup aficionado and I appreciate your experience and help on this. I have tried so much but just started using sketchup this year....so I figured I just didn't understand something but after nothing seemed to work I am thankful you are helping. I hope to hear good news. rich
-
@iaddic said:
sdmitch, I have discovered you are quite the sketchup aficionado and I appreciate your experience and help on this. I have tried so much but just started using sketchup this year....so I figured I just didn't understand something but after nothing seemed to work I am thankful you are helping. I hope to hear good news. rich
Rich, flattery will get you no where.
I have attached your file with the component origins reset just to see if we are headed in the right direction while I'm thinking about the next problem.
-
sdmitch:
I see you have moved the origin to the objects' bounding box. I am not certain I see your next move though. Now the component can be moved to 0,0,0 easy enough but the component editor does not know the object is skewed within the bounding box. I have always positioning the axes on the object so that it can be rotated...understanding of course you know more about this than I do.
Oh, as for flattery...just calling it how I've come to see it! I visited your blog and see you have a treasure chest of tools...You don't build that kind of arsenal without knowing something!
Rich
-
How about this oldie? : http://sketchucation.com/pluginstore?pln=TIG_originatecomponnetsaxes
-
@iaddic said:
sdmitch:
I see you have moved the origin to the objects' bounding box. I am not certain I see your next move though. Now the component can be moved to 0,0,0 easy enough but the component editor does not know the object is skewed within the bounding box. I have always positioning the axes on the object so that it can be rotated...understanding of course you know more about this than I do.
Oh, as for flattery...just calling it how I've come to see it! I visited your blog and see you have a treasure chest of tools...You don't build that kind of arsenal without knowing something!
Rich
The next step is to try to remove the "skew". Don't assume I know anything because I probably don't when it comes to this problem.
-
A new version of the model to checkout. All components "deskewed" except the diagonal ones,Group623#3 and Group625#2, which apparently have to be treated differently for some reason.
Let me know if this solves some of the problem.
-
sdmitch: Yes it does appear all the skew is removed except for the diagonal pieces. Since you've been able to move the component axes and eliminate the skew from most all the components, it is easy enough to rotate the diagonal pieces using the protractor. If this is all that needs to be addressed then we have moved monumentally in the right direction.
Tig: I tried your originate axes script and it is exactly opposite of what I think I need. It moved all the components axes to the origin and then I was still left with the skew.
sdmitch: My only concern is the comment you made indicating you were uncertain why the ones that did not skew didn't. How is this siting with you at the moment? Do you have an understanding? Should we let that dog lie and move forward or do we need to understand that piece as well? As I mentioed, if all I must do is rotate a few components then that is minor compared to the many 100's of steps I would be performing.
What are the next steps then?
With warm regards,
Rich
-
TIG: Let me add...I am not trying to move the component axes to the world axes but align it in such a way that the components that are skewed become de-skewed (unskewed) ...are those words? Anyhow, thank you for looking into the situation...when I tested your script, all the axes moved to the origin...did I interpret that corectly or is there more there then that. Thanks, Rich
-
@iaddic said:
sdmitch: My only concern is the comment you made indicating you were uncertain why the ones that did not skew didn't.
The problem with the diagonal components is they are a component with another component inside and I wasn't expecting that so my logic failed. I will have to think about that some more.
I will send you, by personal message, a copy of the plugin as it currently exist as soon as I get the pieces put together and tested.
-
If you want all group/component axes parallel to one of its edges, can I I suggest the following...
Make an array of all group/component definitions and an initially empty array of processed definitions.
Look inside each group/component to getedges=definition.entities.grep(Sketchup::Edge)
,if ! edges[0]
then find any nested group/component instances, if it's in the processed set get theinstance.transformation.xaxis
and use that ?
But if it is not processed, then process that and then continue using thatinstance.transformation.xaxis
If it contains edges then filter those to get the edge that has its vectoredge.line[1] || edge.line[1].reverse
nearest the X_AXIS, and also the 'flattest' edge ? ... then use that vector...
The code in my script can be applied to transform each definition instance to its new insertion-point and transform its internal entities so they are realigned to suit that, and thereby appear unchanged.
Multiple instances either require multiple processes or make_unique ? -
sdmitch: I hope you understand what TIG is suggesting. For me, it is becoming more and more obvious I will need to learn Ruby...So far I've 6 months getting into the depths of Sketchup and Layout...It is becoming obvious that those who fair the best (in getting the application to do what they need) know Ruby.
-
The native context-menu item 'Change Axes' lets you reset the axes of a selected Component - e.g. so they then align with a skewed beam's sides etc.
This doesn't work on Groups, but you could first use the context-menu 'Make Component' on the Group before resetting its axes...
To revert it back into a Group think about making it into a component, then sorting out that component's axes, then editing its contents, selecting-all and 'Make Group'; finally you exit that edit and explode the component, the resultant no longer nested Group will retain reset axes matching the temporary component container... -
TIG: I have been doing something similar on a component by component basis. The problem is some of my models have 100's of these skewed objects (the example I show is small). Hence, sdmitch has been looking to help solve the problem in mass. The need for doing so is driven by that fact the skewed objects must be detailed in Layout and can not be done so accurately while they are skewed.
So the thought was simple...the solution less so.
1.) reset the axis
2.) de-skew
3.) use the Plugin Parts-->Scene
4.) Detail in LayoutStep 1 and 2 were taking forever doing them manually so I asked for help in
1.) Asking if I first understood my problem
2.) Seeking alternative existing solutions
3.) finding help in developing a solution for the problem in scale.Seems like sdmitch has a 95% solution. As you can see from his posts, most of the objects are de-skewed with the script he is working on except for nested ones. This is huge and if he solves the last piece it is monumental for me personally. If I had just a few items to contend with I would use the native menu driven solutions. That works fine...but when many model with many items are in this condition the problem is, well...difficult.
Advertisement