Correcting the orientation of 3D models

As related to this topic (of Origin’s with respect to Electronic parts used in Kicad and elsewhere):

You don’t care but, Once upon a time I worked for two ‘Connector’ Companies, I was Director of Engineering for a division of JAE and a Senior Design/Development Engr/Mgr for AMP. Thus, many engineer’s designs came to my desk and I taught CAD to engineers. My comments below stem from that work and working with these clients: Ford, BMW, Volvo, Visteon, Delphi, Delco, Molex, Lemo, Takata, Dyonix, Wolf, Storz and many more companies. And, my own Patents/designs.

There are NO rules, laws, Industry Standards, etc about how to Model parts or where to place Origins. The choice of Origin placement is made based on Personal Preference, Anticipation of Future Design Changes, aspects that make modeling easier or more difficult, software being used, the original intended usage of the part… There are Drafting/Drawing standards but, no Modeling standards.

Take a look at several of the STEP files that come with Kicad (example screenshots below show Origin’s in different locations… I opened them in FreeCAD) Origins are difficult to see so, I drew Yellow ring around them…

Does anyone really think that an engineer sitting at his/her desk is thinking about what Kicad, Altium, Fritzing, Fusion, and the host of others need for Origin?

The parts shown are:
Molex 55560_0601
Molex_AE_6410_09A
CUK_JS202011CQN DPDT
SW_DIP_SPSTx03_Piano
Fusion032_sp

I do not care about 3d models origin either. I make my models the easiest way I can find.

Then I match my model with its footprint with Kicad-StepUp.

This workflow is perfect to my needs.

1 Like

but in KiCAD 3d viewer you can align your model to the footprint only in a approximate way… your alignment is only based on visual feedback; you cannot measure anything in 3D, nor place a model in the center of anything or even a pin in the center of a pad.
The best way is act in a mechanical environment… that is why StepUp was created.

a few models do have sensible origins based on their geometry, just somewhere else and the offsets match some drawing value.
You’re absolutely right, actually measuring to verify is key, I omitted that when I wanted to point out that using something else than (1 1 1)(0 0 0)(0 0 0) didn’t produce any errors for some time for me. I have to use SolidWorks anyway, so I’ll usually just use that to find the origin and measure the offset values.

Do having these parameters set to 0 are only important to meet the requirements of the KiCad library?
If yes than everything is clear. No more questions.

This looks for me as separate subject. Not related to libraries. It is separate as for libraries z rotation also have to be 0 but in this subject not. I am not interested in the subject of KiCad library defined needs but only in this one (allowing z rotation to not be 0).
To tell you the truth I don’t understand this sentence (but have in mind that I have 0 experience with 3D CAD).
You write that I have these parameters set to 0 when I import the model to FreeCAD. But I import the model not coming from KiCad but for example from real part manufacturer page. The model has nothing common with KiCad yet so it can’t have KiCad defined offset and rotation parameters. These parameters simply don’t exists yet. I use FreeCAD + StepUp to position that model to allow me later when using this model in KiCad to set KiCad offset and rotation parameters to zeros.
I understand having these zeros as a goal that I want to achieve and you write as if it were a condition without which using FreeCAD to align the model is impossible. I don’t know what you have in mind. I feel that I don’t understand something. And why in this sense you exclude z rotation from being required to be 0. What special is in z rotation. If x,y rotations are wrong than model is wrongly aligned to footprint, but if z rotation is wrong the model is also wrongly aligned.

I can imagine using StepUp to move model to such position that in KiCad to have it correctly aligned to footprint I will have to set offsets other than 0. So I don’t feel having them 0 to be mandatory to use StepUp. I all the time assume that having them being 0 is mandatory because if not zero I will fall into some wrong consequences I just don’t know them.
Because you allow for z rotation and write that for library z rotation should not be allowed it means for me that these wrong consequences are something different than simply a failure to meet library requirements.
I believe that what I wrote allows you to catch what I understand differently.

  1. you need to understand the StepUp workflow, to understand its instructions.
  2. in StepUp you can import a kicad footprint inside the 3d mechanical environment.
  3. after having the fp inside FC, then you import your model to the same document.
  4. here you can measure the distance of the 3d object from the 3d model of the footprint. Then you could take note of these values to assign those in your fp or (as kSU approach) move the 3d object to match the footprint placement and export the 3d model with this placement. This option will then force your footprint to have all the placement values to 0.
  5. the rotation on z plane is related to the footprint design; kicad libraries have some convention but each user may have a different convention in design his/her footprint (i.e. pin 1 at top or at left etc). Then the need to leave this option (orientation on z plane) free.

Hoping this has solved your doubs in why I wrote those notes on kSU instructions.

Thank you for trying to clear up my doubts. I understand (I think perfectly) points 1,2,3,4.
With 5 I have still lot of doubts. I understand it that way: The 3D model in KiCad official library will have all placement values 0, but the user who will define his own footprint 90° rotated is expected to use the same 3D model giving it z rotation. Assuming he will do it you call as leaving this one parameter free.
My (long list of) questions:
What that really means that this one parameter (and only this one) is free?
Telling that this one is free suggests that others are not free. So users (using external source 3D models) should not use them.
Why they should not use them?
If they use them then they are doing against what?
What threatens them when they use all the parameters?
Do this restriction should be fulfilled always or only in some circumstances? What circumstances?
Is this restriction connected only with publishing someones footprint with his 3D model, or he should not use these parameters even he is using the model only for his own purposes?
In your cheat sheet it is written as if these requirements were always in force (they are mandatory).

At the beginning of this thread there was suggestion to freely use all positioning parameters.
And I spoke out against it because I remembered (from your cheat sheet) that it is mandatory that all parameters (except rotation z) should not be used.
I just would like to understand how strong this mandatory is. Until this thread I understood it that if I use them I can get into some problems in the future (may be when I will be trying to use 3D model of my whole PCB someway).
Now I do not know what will happen to me if I do not follow the mandatory of not using other then z rotation parameters in KiCad. Is it danger in any way or not? If not then why you call it mandatory?

Aren’t you overthinking this? If something works for you, it works.

It makes sense in context of KiCad to use model which doesn’t need any movement or rotation, and if you use StepUp, why not just make the model according to that convention?

You make it sound like you would be thrown into Gehenna or something like that. The worst that could happen is that you need a board 3D model with part models later for something which you don’t know yet, and something (a 3rd party exporter/importer?) doesn’t understand the movements and rotations in the KiCad file and the part models are placed wrong. In case it happens – which is improbable – can’t you just fix them then?

The main reason is that I like to understand tools I am using.

And I do it that way since 2017 when started to use KiCad. I didn’t tried to overthinking this until this thread. Seeing suggestion to use all those parameters positioning 3D model I protested as I remembered that mandatory is not to use them.
Now I am trying to find “was I the protesting right”.

If it would be 3rd party software I would don’t care as I don’t plan to use it. I expected (I was pretty sure) that may be some functions in StepUp ignores these parameters as it is in StepUp cheat sheet where I have read that not using them is mandatory.
StepUp has dozens functions from which I learned to use 4 or 5 only, but expect to use more in future.

When I saw the suggestion to use all of this positioning parameters I assumed that this can lead to some problems in unknown by me yet StepUp functions so may be it is wrong suggestion. When I see here wrong suggestion I am trying to at least point it.
My problem this time is I still don’t know if that is good suggestion or not.
I decided to have all these parameters set to 0 but I had to learn to use FreeCAD and StepUp what took me significant time.
If not using these parameters are practically not mandatory then it looks I lost time on learning how to not use them.
The problem is - what is the right suggestion to OP:

  1. To freely use these parameters
  2. To learn how to modify a model to not use them.

If you plan to limit your 3D modeling to only working within Kicad, you may do #1 . ( I assumed “To freely use these parameters” meant to use/modify the parameters in the Kicad 3D part dialog)

If you plan to hand off the 3D model of the PCB assembly to another MCAD program (e.g. Fusion 360, Inventor, Solidworks, Creo, etc.), and follow the KLC you should do #2. (I assume “To learn how to modify a model to not use them.” means modify the model in StepUp and keep the parameters in the Kicad 3D part dialog at zero.)

Therefore, the right suggestion is doing #2 as best practice to both match the Kicad KLC requirements and guarantee a clean export to other MCAD software. Also, the StepUp learning curve isn’t very steep and you will be more productive and faster than using the Kicad parameters (even with having to insert FreeCAD into your workflow).

I don’t understand what can be the reason of not clean export. I understand that when KiCad exports PCB to STEP file than it uses each model positioning parameters to add that model using descriptions allowed in STEP file format. If such models can’t be inserted there with those modifying parameters then during export it has to be converted accordingly to be able to represent it in right STEP file format.
So if KiCad exports it to the right STEP file then all MCAD programs should simply accept it with no problems, I think.
Thinking that way and reading (in StepUp description) that not using these modifying parameters is mandatory I supposed that I should expect problems only in not known by me yet functions of StepUp.

Seeing that my suggestion was what started this whole discussion, let me throw in my 5c worth. I think the problem is that applying a chain of transforms depends on the order that they are applied. So rotate() → translate() → scale() would not necessarily result in the same result as for example translate() → scale() → rotate(). If all the arguments are zero then you won’t have any surprises depending on the order that the transforms are applied by the consumer of the model.

1 Like

I think not your suggestion, but my willingness to take this opportunity to finally understand why these parameters should not be used. If I do something as I was told to do it only that way for years and I don’t understand why I have to do it that way, it just frustrates me.

since the screenshot you posted, it is clear that the suggestion comes from the StepUp WB, then this suggestion is exactly for the use of the StepUp WB

All depends on which level of precision you want in your 3d model design…

and

because in 3D environment you align your model to the footprint… the only variable respect the position of the pads in the footprint is the orientation of anchor reference in plane z

everyone has to find his/her way to work in designing environment…

IMO the best and only way is to use a mechanical integration with all the 3d library aligned to KLC.

who told you that? (see the note on the initial mention few lines above)

Note:
please remember that in kicad very old version (apr 2016) there were not even the 3d preview of the placement of 3d model, so the placement was just try and catch.

Mario’s latest changes use his new 3DViewer to provide the preview in the Footprint Properties dialog. This means the preview now has a board with the component’s footprint on it so you can adjust the location (and scaling of VRML/X3D models).

here the old thread

Okay, I think I have spent far too much time on this ‘issue

It is probably obvious for you, but it was never obvious for me. Cheat sheet nature is that it can contain facts without explanations (the manual would look differently). So I couldn’t be sure if the rule ‘not use these parameters’ I should read ‘not use these parameters to avoid any problems in StepUp’ or ‘not use these parameters ever’. A safer version was to assume that you know about some problems anywhere and just noted to not use these parameters.
In my cheat sheets I frequently write the rule without information of its source. It is just the rule to follow for me.
So I remembered to not use these parameters. As you can see from thread beginning I didn’t remembered where I know it from.
When I was 20 I would probably easy remember the rule and its source. Now I am happy that I remember the rule and I don’t care too much if I don’t remember where it comes from.

This is the aspect I didn’t considered. Looking at THT pin from bottom you can find offset values with better precision than real part will be assembled.

I have read this few times, I used Google translator to be sure and I don’t understand what you have in mind. For me the matching of pins to pads is influenced by x,y offsets and z rotation and not only by z rotation.

Right. But the way is based on some adopted rules. And it is better to understand why you adopted those rules.

I think you are right that it is the best. But if it was the only way then in KiCad there would be not these parameters we discuss in this thread. But they are. I would freely use them if I had not noticed the rules in your cheat sheet. So I don’t use them but really don’t know why.
As you are using it probably daily it may be hard to understand for you but if I have to position two 3rd source models per year I have to learn how to do it almost anew every time (how to load footprint, how to load model, how to measure anything, if you want to position model visually you can’t write consecutive approximations for offsets but you have to shift with smaller and smaller steps). Using just KiCad parameters seems for me easier but fearing some unknown consequences I don’t do it.

If something is said to be mandatory I understand that I was told to do it that way. Have in mind that here many people (like me) use English in not the best way and some sentences uses not the best suited for it words.

I don’t understand.

That explains why StepUp was needed (I didn’t saw KiCad in 2016).
I consider StepUp a brilliant tool. I only don’t understand why not using these positioning parameters in KiCad is mandatory.

Than you. I believe that you have more important things to do.

probably because you missed something in the document:

  1. the document Title is KiCad StepUp tools cheat sheet
  2. the mandatory mention is in a page with StepUp WorkFlow for 3D models as paragraph title
  3. there is a Note in which StepUp is mentioned clearly

Note:
when aligning a 3D model to a kicad footprint,
StepUp takes care of:

  • 2D footprint rotation of kicad for the footprint alignment
  • vrml model z rotation

It is mandatory that the footprint has:

  • x and y of the 3D model rotation set to 0
  • x, y and z of the 3D model translation set to 0
    The user has to check/modify, if needed, the part of 3D vrml/step model in kicad as following
    (model path/name.wrl
    (at (xyz 0 0 0))
    (scale (xyz 1 1 1))
    (rotate (xyz 0 0 0))
    at (xyz 0 0 0) is mandatory, as much as scale (1 1 1)
    rotate (xyz 0 0 z_value) can have a z rotation value

Thanks

these parameters placement is needed to have the 3D model aligned in FC between the footprint and the 3D model. If you have aligned the model to its fp in MCAD (FC) and exported the model as Step, now you must keep these values to zero to avoid a misalignment of the step model both in Kicad and in FC, when you will load the pcb inside the mechanical environment.

Very likely.

That suggests that StepUp automatically rotates footprint or model when got some order from user. I never used (never found) that function.

I still think that you assume that I (and other readers) follow your way of understanding this, but I even don’t catch your understanding.
It looks like you are saying that these values have to be 0 prior loading the footprint to FC. I never even supposed such understanding as it seems to me to be unfounded. I don’t see any relation of these values to footprint and the 3D model loading to FC.
You load footprint from KiCad and separate 3D model and then allow to move and rotate model to align it to footprint.
These values has nothing to footprint itself. They only specify how to position 3D model versus footprint. So loading footprint you need not to look at them.
The 3D model (coming from somewhere) also have no them in it. So while loading footprint and 3D model you have nothing to do with these values.
If you said that after aligning 3D model in FC and exporting it to KiCad to have in KiCad the model positioned exactly as you sow it in FC all these values in KiCad should be set to 0 then I would understand it but what you say it looks like if they are not set to 0 prior loading footprint by StepUp then something will not work correctly. I don’t see the reason for it so I don’t assume such understanding and automatically, subconsciously search for other “what the author had in mind”.

I still do not understand what with z rotation. Is it possible that after aligning model to footprint and exporting model to KiCad you will have to set z rotation other then 0 to have model positioned in KiCad like it was just a moment ago in FC?
If no - then why z rotation is not listed like other parameters to be 0.
If yes - how it can happen.

May be the reason is that I didn’t found the function when StepUp takes care of 2D rotation. May be there is the function to automatically align model to footprint that instead of rotating model just assumes there will be some rotation set in KiCad footprint. But I only exported model and not footprint after aligning so which way this z rotation will reach KiCad.

Now (while writing it) I got the absolutely new idea for me. May be loading footprint form KiCad you ignore all positioning parameters except z rotation and while aligning you all the time corrects the view with this z rotation coming from KiCad. Now, when I got that idea it seems for me very probable.
But it seems for me lightly cheating on the user. He sees model aligned while really it is not fully aligned.
If you really do it that way than my first moment opinion is that it is a mistake. In my opinion you should ignore all positioning parameters when importing footprint. May be I just don’t know something important.

this has become an endless story running in circles :wave:

I have never used any 3D CAD program before I saw a note after installing KiCad to use FreeCAD.
That doesn’t mean that I didn’t designed 3D. I just used only 2D drawing to express my designs.
As I know only FreeCAD I have no comparison to others so I can’t say that I have used better interface.

I remember I was able to do measurements and then calculate needed offset. But it was not so easy. Pin had square tip (like pin headers have) so I couldn’t measure to its center but only to that square edge. And probably (2 years ago - don’t remember well) I was not able to measure to round hole but only to rectangle pad edge. When I selected both lines (they are paralel) the rectangular triangle was shown with distances in two axes and direct. If the pin was in its whole out of hole and I had two measures both toward the same side you always have to think a moment what from your measurements come out.

I put both files to KiCad as I don’t understand the difference between them and I have read somewhere that KiCad sometimes needs one of them and sometimes the other.

This is as I have written: “If you said that after aligning 3D model in FC and exporting it to KiCad to have in KiCad the model positioned exactly as you sow it in FC all these values in KiCad should be set to 0 then I would understand it”

Read last paragraph of my previous post. Now I suppose that it is true. When next time I will be using FreeCAD to position 3D model I will try to see what will happen if I set z rotation other then 0 before loading the footprint to FreeCAD (to check if it is that what is said that StepUp takes care of z rotation).
I suppose that it is true because I can’t imagine other explanation now.

I cannot imagine uncreated things. I just understood that you shouldn’t use these parameters for some reason. In such a situation, I prefer to know what the cause is.
May be while loading footprint these parameters are not ignored (as I have written previously) but checked and if not 0 program refuses to load footprint so they have to be 0 (mandatory).
Anyway my understanding of why these parameters should be not used is completely different than during last 4 years.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.