Jump to content

How to Mirrior Parts Symmetrically


Starlord Kerman

Recommended Posts

I am trying to mirror surface attaching wings, however, when I mirror them the mirrored wing ends up being upside down or faces backwards. I notice all the stock wings are symmetrical such that there is no top and bottom, maybe for this reason. However, there are parts that mirror how I am hoping for the wings to mirror, the best example being landing gear.

Spoiler

screenshot34.png

It seems that the mirror function in most cases besides this landing gear, just places the original part in a different orientation on the opposite side, but in this case it seems to generate a mirrored version of the original part. Does anyone know how to use the mirror function in this way? :/

thanks in advance

Link to comment
Share on other sites

I think that mirrored gears are always "inverted" when put on the symmetrical point - but since some of them are already symmetrical in shape, the net result is an apparent copy of the mesh. 

So I made this monstrosity, and gone peeking on the .craft file. I have three identical gears - one pair is mirrored, the third is not. Let's compare:

07_Mirroring-Gears.jpg

Mirrored Gear 1:

PART
{
        part = GearFixed_4293761660
        partName = Part
        persistentId = 1351969621
        pos = -0.585137546,9.84321308,-0.150621384
        attPos = 0,0,0
        attPos0 = -0.585137546,-0.150621355,0.156786948
        rot = 0.00416839123,0.0108874142,0.130581394,0.991369128
        attRot = 0,0,0,1
        attRot0 = -0.698056281,0.100033544,0.08463642,0.703951299
        mir = 1,1,1
        symMethod = Mirror
        autostrutMode = ForceHeaviest
        rigidAttachment = False
        istg = -1
        resPri = 0
        dstg = 0
        sidx = -1
        sqor = -1
        sepI = -1
        attm = 1
        modCost = 0
        modMass = 0
        modSize = 0,0,0
        sym = GearFixed_4293761560
        srfN = srfAttach,Mark1Cockpit_4293781902

Mirrored Gear 2 (counter part):

PART
{
        part = GearFixed_4293761560
        partName = Part
        persistentId = 1350094561
        pos = 0.585137546,9.84321308,-0.150621444
        attPos = 0,0,0
        attPos0 = 0.585137546,-0.150621414,0.156786948
        rot = 0.130581379,0.991369128,0.00416839123,0.0108873807
        attRot = 0,0,0,1
        attRot0 = 0.0846364349,0.703951299,-0.698056281,0.100033514
        mir = 1,1,-1
        symMethod = Mirror
        autostrutMode = ForceHeaviest
        rigidAttachment = False
        istg = -1
        resPri = 0
        dstg = 0
        sidx = -1
        sqor = -1
        sepI = -1
        attm = 1
        modCost = 0
        modMass = 0
        modSize = 0,0,0
        sym = GearFixed_4293761660
        srfN = srfAttach,Mark1Cockpit_4293781902

-------

And finally, the single gear:

PART
{
        part = GearFixed_4293760032
        partName = Part
        persistentId = 731760417
        pos = -0.090433903,9.84336376,2.865376
        attPos = 0,0,0
        attPos0 = -0.090433903,2.86537576,0.156636
        rot = -0.132891148,0.240856349,0.47938621,0.833377004
        attRot = 0,0,0,1
        attRot0 = -0.683254719,0.509288371,0.168666065,0.495318294
        mir = 1,1,-1
        symMethod = Mirror
        autostrutMode = ForceHeaviest
        rigidAttachment = False
        istg = -1
        resPri = 0
        dstg = 0
        sidx = -1
        sqor = -1
        sepI = -1
        attm = 1
        modCost = 0
        modMass = 0
        modSize = 0,0,0
        srfN = srfAttach,Mark1Cockpit_4293781902

——— 

My current conclusion (subject to change as more informed people gathers here!) is that the "symMethod" alone doesn't define a mirrored part, you need **also** to define the counterpart on the "sym" field.

The magic appears to be made by using the "mir" field, where you use a "-1"  to indicate the axis you wanna invert. Apparently using the -1 on the third value invert the part the way we want on gears. Note the "pos" field - the first value is the X axis, negative numbers are "from the left", positive numbers are "to the right". Y is from the bottom to the top (see how all gears are on the same Y plane!), and Z is from back to the front (note how the third gear change the 3rd value relative to the first pair!).

Building a craft like that and playing with that numbers on the craft file will render some interesting information!

Edited by Lisias
typos. yet more typos.
Link to comment
Share on other sites

On 2/6/2019 at 7:35 PM, Lisias said:

The magic appears to be made by using the "mir" field, where you use a "-1"

Thanks for the help, I just got it to mirror:

Spoiler

Pkjncs1.jpg

I'm not sure what finally got it to work and what is extra but here's the important part of the .cfg

	name = PSCurvedWing
	module = Part
	author = NYoung
	rescaleFactor = 1
	node_attach = -1.7, 0.0, 0.8, 1.0, 0.0, 0.0, 3
	mirrorRefAxis = 0,0,1
	node_stack_bottom02 = -5.027493, -2.76, -0.165882, 0.0, -1.0, 0.0, 1

 

Link to comment
Share on other sites

47 minutes ago, JadeOfMaar said:

The mirrorRefAxis key is all that you needed. That's the easy part. The hard part is getting anything stack attached to the wings to also mirror. I've been working at this but I haven't gotten it right.

I see exactly what you mean. :)

kCPSDDP.png

https://imgur.com/kCPSDDP

Link to comment
Share on other sites

On 2/10/2019 at 4:42 PM, JadeOfMaar said:

The hard part is getting anything stack attached to the wings to also mirror.

So getting something attached to a node to mirror? That could solve a lot of problems that I have run into. I assumed it was impossible, but I will look into it as well.

Edited by Starlord Kerman
Link to comment
Share on other sites

1 hour ago, Starlord Kerman said:

So getting something attached to a node to mirror? That could solve a lot of problems that I have run into. I assumed it was impossible, but I will look into it as well.

I think you quoted the wrong guy! :D

See above on my image, it's essentially what I had done. A structural fuselage as pivot,  a strut and that AGM of mine made using B9 Procedural Parts and Procedural Wings. Note, however, that there're still some work to be done - see how the Control Surfaces got terrible wrong on the right AGM.

Getting mirrored parts to still work when the attached part is mirrored too appears to be the next challenge.

Link to comment
Share on other sites

  • 2 weeks later...

Mirroring parts when attached to a single stack node on another part cannot be done. The way this works (as can be seen in bicouplers to quadcouplers to maybe even the MH engine plates) is as follows:

The parent part must have stack nodes in position for symmetry. All of these must have the name node_stack_somethingIdentical = ...

Then the part must also have the key stackSymmetry = x (where x is n - 1, the number of these identical nodes - 1). A quadcoupler will have stackSymmetry = 3. A bicoupler will have stackSymmetry = 1. The part can only be configured for symmetry at the one set of nodes so, for example, you cannot get to choose between 2-way and 3-way on the same part. If there are exceptions to this rule in the stock parts or parts that can change meshes and stack nodes then I've never noticed. If you encounter such parts, let me know.

The following is from an engine mount with many stack nodes, however the ones for engines are 6 in symmetry around a 7th center one. It therefore has stackSymmetry = 5.

node_stack_top = 0.0, 3.961, 0.0, 0.0, 1.0, 0.0, 4
node_stack_bottom = 0.0, -4.088, 0.0, 0.0, -1.0, 0.0, 4
node_stack_finDorsal = 0.0, -1.261481, -2.811267, -1.0, 0.0, 0.0, 3
node_stack_finLeft = -2.43021, -1.117413, 1.401912, 0.5, 0.0, 0.866, 3
node_stack_finRight = 2.428806, -1.117413, 1.401912, 0.5, 0.0, -0.866, 3
	
node_stack_Engine_Center = 0.0, -2.485, 0.0, 0.0, -1.0, 0.0,0
node_stack_Engine = 0.0, -2.485, 1.0, 0.0, -1.0, 0.0,0
node_stack_Engine = 0.0, -2.485, -1.0, 0.0, -1.0, 0.0,0
node_stack_Engine = 0.8660254, -2.485, 0.5, 0.0, -1.0, 0.0,0
node_stack_Engine = -0.8660254, -2.485, 0.5, 0.0, -1.0, 0.0,0
node_stack_Engine = -0.8660254, -2.485, -0.5, 0.0, -1.0, 0.0,0
node_stack_Engine = 0.8660254, -2.485, -0.5, 0.0, -1.0, 0.0,0
	
CoMOffset = 0.0, 3.0, 0.0
node_attach = 0.0, 0.0, -1.89, 0.0, 0.0, 1.0
stackSymmetry = 5

 

On 2/20/2019 at 1:33 AM, Starlord Kerman said:

mirror them on a node in symmetrical mode which is really what I need to do.

You shouldn't care about mirroring wings on stack nodes by the way. Anyone who knows what they're doing will surface-attach in symmetry and then offset to the appropriate position. Placing them on stack nodes will provoke the wrath of the drag cube system. I will publish an explanation on this, which I call "Adapter Drag" soon™.

Link to comment
Share on other sites

  • 2 weeks later...

I am using B9 part switch to switch the wings between node attach and surface attach. The wings mirror fine when surface attaching, however I still can not get them to mirror when node attaching.

Ifw1oKL.gif

As you can see in the gif, I have a dedicated part for the wings to mirror across. The part has nodes on each side and stack symmetry = 1. I have tried with the nodes facing out from the sides, and with the nodes both pointing towards the back, without success. :/

If anyone wants to take a look, I put all the files needed for the wing and the dedicated wing mount in a separate project on github. (B9 will have to be downloaded separately)

https://github.com/StarlordKerman/SweptWing

Although the wings don't mirror, it is possible to get a right and left wing by using 'e' or 'q' to switch orientations.

	name = wingAttachmentSystem
	module = Part

	rescaleFactor = 1
	node_stack_top = 0, 0.0, -1.25, 0.0, 1.0, 0.0, 3
	node_stack_bottom = 0, 0.0, -1.25, 0.0, -1.0, 0.0, 3

	node_stack_finLeft = 1.7075, 0.0, 0.0, 0, -1, 0.0, 3 		
	node_stack_finRight = -1.7075, 0.0, 0.0, 0, -1, 0.0, 3 	

	CoMOffset = 0.0, 0.0, 0.4
	CoPOffset = 0.0, 0.0, 0.0
	CoLOffset = 0.0, 0.0, 0.0
	stackSymmetry = 1
	mirrorRefAxis = 0,0,-1

 

Link to comment
Share on other sites

6 hours ago, Starlord Kerman said:

I am using B9 part switch to switch the wings between node attach and surface attach. The wings mirror fine when surface attaching, however I still can not get them to mirror when node attaching.

Use a octogonal strut to hang the wings. As it was said before, mirroring is not possible on parts attached to nodes, only on surfaces. And this includes the parts you are using to attach more parts - the thing cascades.

(I don't know the reason why this happens - perhaps can be something we could work around on custom parts, but I don't see a point on doing that without the Stock parts jumping suit on it)

Link to comment
Share on other sites

3 hours ago, Starlord Kerman said:

It is possible, I just can't get it to work for the wings.

Well… You have a point. :) 

So, let me correct myself: "mirroring is not possible using control surfaces on a node" :) 

But yet, give a look on @JadeOfMaar's post above. Perhaps you would get better results doing what he suggests.

Edited by Lisias
Dude… my English is terrible...
Link to comment
Share on other sites

At the moment, I am not worried about mirroring the control surfaces, I would be overjoyed just to mirror the wings.

I do not understand what makes the wings different than the parts that I mirror in the above GIF. They all incorporate multiple nodes, and have the same mirror axis, yet they behave much differently than the wings.

The only difference I see is the wings are not symmetrical. It is like I said in the original post, KSP seems to struggle when it would be forced to generate a mirror image part.

Yet it seems to easily generate mirrored geometry when I use "e" to rotate the part, it just fails to when I try to mirror across the nodes.

Spoiler

gCesjXa.gif

 

 

Link to comment
Share on other sites

29 minutes ago, Starlord Kerman said:

At the moment, I am not worried about mirroring the control surfaces, I would be overjoyed just to mirror the wings.

I do not understand what makes the wings different than the parts that I mirror in the above GIF.

The issue is in the parent part, not the wing, as I explained clearly in my post on February 21st, that @Lisias is pointing you at.

The parent part needs to have (some) stack nodes with near-identical names for symmetry to work properly. You should have, example:

// Yes
node_stack_top = ...
node_stack_side1 = ...
node_stack_side2 = ...
node_stack_bottom = ...
stackSymmetry = 1

// No
node_stack_top = ...
node_stack_left = ...
node_stack_right = ...
node_stack_bottom = ...
stackSymmetry = 1

Where symmetry will recognize the similar "side" nodes. You should never be meeting this problem.

There's also no need to try to "toggle between stack and surface attach." It's easy to do that just by holding the left Alt key and that's when you want to use the stack node.

The reason everything other than wings mirror well on stack nodes is that everything (especially tanks) is symmetrical in every axis that matters so it really never matters how you attach them.

Edit: I stand corrected. The parent part seems to be configured right. (It doesn't need to have the mirrorRefAxis key, though). Perhaps reduce the "left" and "right" suffixes on the stack nodes to just one digit or to none/nothing at all.

Link to comment
Share on other sites

7 minutes ago, JadeOfMaar said:

Perhaps reduce the "left" and "right" suffixes on the stack nodes to just one digit or to none/nothing at all.

Ok, that is a good idea. I'll reduce the complexity of the names. I'll try side1 and side 2.

Another thing that I've been looking at is currently all the notes are on one plane, so I'm thinking if I move the center nodes forwards or backwards a couple meters, it might be less likely to confuse them with the two nodes I want to mirror on. (probably shouldn't matter, but I'll try it)

Link to comment
Share on other sites

3 hours ago, Starlord Kerman said:

Ok, that is a good idea. I'll reduce the complexity of the names. I'll try side1 and side 2.

Another thing that I've been looking at is currently all the notes are on one plane, so I'm thinking if I move the center nodes forwards or backwards a couple meters, it might be less likely to confuse them with the two nodes I want to mirror on. (probably shouldn't matter, but I'll try it)

I was doing some testing, and commented out the node_attach in the SweptWing, and then it started to mirror on node attachment

It looks like if there is a node_attach, then mirroring is disabled

Link to comment
Share on other sites

4 hours ago, linuxgurugamer said:

I was doing some testing, and commented out the node_attach in the SweptWing, and then it started to mirror on node attachment

I tried that and it didn't work. Was this also after you reoriented the nodes, as you mentioned in the other thread? It could be a combination of the two things. Maybe just post the text file.

Link to comment
Share on other sites

8 hours ago, Starlord Kerman said:

I tried that and it didn't work. Was this also after you reoriented the nodes, as you mentioned in the other thread? It could be a combination of the two things. Maybe just post the text file.

Yes.  I’ll package  it all up later when I get home

Link to comment
Share on other sites

So, in other words, parts *have* to be *only* stack attachable, and *cannot* be both surface and stack attachable , for mirror symmetry to work?

I know MOARdV fixed mirror symmetry with AviationLights, but they *are* only surface attachable... So in other words, i assume stack parts can be mirrored properly, and surface mount parts can be mirrored properly... but if the part uses *both* methods, theres no way to have mirroring work?

Edited by Stone Blue
Link to comment
Share on other sites

6 minutes ago, Stone Blue said:

So, in other words, parts *have* to be *only* stack attachable, and *cannot* be both surface and stack attachable , for mirror symmetry to work?

I know MOARdV fixed mirror symmetry with AviationLights, but they *are* only surface attachable... So in other words, i assume stack parts can be mirrored properly, and surface mount parts can be mirrored properly... but if the part uses *both* methods, theres no way to have mirroring work?

That's my impression, I'm going to redo my tests and then post the results

Link to comment
Share on other sites

Ok, so I have it working, both for node attach and surface attach, but it's kind of weird.  The following instructions apply to the files in the linked zip:

For this to work, the B9 Part Switcher is required.

To do surface attach, you need to be in Mirror Symmetry mode, and the wing needs to be set to Surface Attach

To do node attach, you need to be in Radial Symmetry mode, and the wing needs to be set to Node Attach.  Surface attach will still work with this, but the two wings will be directly opposite each other.

The files have had all the attachment node oriented in the correct direction.

https://www.dropbox.com/s/anoo0hxnukk0skn/TriCrossSection.zip?dl=0

The following video shows the wings working:

 

Edited by linuxgurugamer
Link to comment
Share on other sites

13 hours ago, linuxgurugamer said:

For this to work, the B9 Part Switcher is required.

O...M...G... :face_palm:
Cant beleive no one (myself included) thought to use B9 that way for this... especially since I've known, like, forever, that B9 could *do* node switching :P

:side_glances_@_: @JadeOfMaar ...

Edited by Stone Blue
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...