Wish: Mirror CPlane

Is there a way to mirror a CPlane along the X-axis, Y-axis, Z-axis or use a Mirror 3pt? I can’t find such an option. :slight_smile:

I doubt this is possible, the Cplane axis order is always the same. If you would mirror, one of the axis would be inverted. I think the only option here is to rotate the plane instead. Maybe if you explain how you would use it, you can achieve the same with different tools?
For example I often use the following macro to flip the plane:
_Cplane _Rotate X 180

That’s correct, the CPlane axis order will have to be different if using a “CPlane mirror” command (swapping XY to YX to keep Z mirrored). My request was to mirror the CPlane in a similar fashion like mirroring a flat surface. Here is the Gumball in “Align to object” mode. I made two screenshots and combined them together to show how the Gumball’s axes appear on the mirrored planes. Something similar should be done when mirroring a CPlane, too. :slight_smile:

Hi Bobi - you can’t have the one on the left… that one breaks the rules , if I am reading it right.

-Pascal

Hi Pascal, is not it possible to make a “hack” for this command to work, like a series of automated macros in the following steps:

  1. Press the “Mirror CPlane” icon (lets imagine that it exists);
  2. Create a plane with some size (lets say 20x20 mm) on the XY coordinate and starting from the center of the current CPlane;
  3. Make a mirrored plane along the Y-axis (this is the most used mirroring plane for designing cars, boats etc) or ask for a manually set mirror axis or 3 point plane;
  4. Set a new CPlane on the newly created mirrored 20x20 mm plane.

This is how I do it manually to have a mirrored CPlane, though it takes some time do execute all the commands mentioned above. :slight_smile:

I just meant that you cannot have a CPlane that is oriented this way, or am I reading the image wrong? :

-Pascal

The original plane was on the right side of my screen-shot, and then I made a mirrored copy on the left side along the World Y-axis. :slight_smile: Here is a video showing how I created both planes and inclined them to make it more obvious how the “Mirror CPlane” should work (mirroring the Z-axis, while the X-axis and Y-axis get swapped to maintain the orientation of all 3 axes).

Mirror CPlane.3dm (30.2 KB)

in that case this could do it: example: mirror around YZ plane:


import Rhino

mplane = Rhino.Geometry.Plane.WorldYZ

currentplane = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.ConstructionPlane()
transform = Rhino.Geometry.Transform.Mirror(mplane)

currentplane.Transform(transform)
Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.SetConstructionPlane(currentplane)

Right, you just can not ever get the mirrored +Z as in the OP’s image…

-Pascal

Lets say that the right plane is where the custom CPlane is located. To make a mirror copy of that CPlane along the World Y-axis, the CPlane must be temporarily reset to the default world CPlane, then it’s Y-axis is used to make a mirrored copy of the previous CPlane (the custom one). I’m not a programmer, but this is how I image it could work. :slight_smile:

Can you explain how to test this script? :space_invader:

this one is a bit better:

to test, open Python editor and past in that script, then run (EditPythonScript)

import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc

mplane = Rhino.Geometry.Plane.WorldYZ

currentplane = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.ConstructionPlane()

transform = Rhino.Geometry.Transform.Mirror(mplane)

currentplane.Transform(transform)
Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.SetConstructionPlane(currentplane)

sc.doc.Views.Redraw()

1 Like

This one works great. Very close to what I was looking for. :slight_smile: I saved it like “Mirror CPlane.py” and added it as a RMB click to the “Set CPlane by 3 points” icon.
I think that “McNeel” should seriously consider to add this functionality in future Rhino 7 releases by default.

Mirror CPlane.py (418 Bytes)

1 Like

The problem is, you cannot mirror a CPlane, you can only mirror a CPlane position. I am not too keen on the idea of a Rhino command that does not quite do it…

-Pascal

Yes, exactly for that reason I mentioned that since the position of the XYZ axes relative to each other is fixed, a mirrored CPlane should have one or two of its axes oriented in a different direction. In the example from my screen-shot above, XY becomes YX to keep the orientation of the axes as they should be. :slight_smile:
That’s also true in @Gijs ’ script where the X-axis and Y-axis are preserved, but the Z-axis is flipped. That’s perfectly fine, because the important thing is to mirror the XY plane of the CPlane relative to the World plane.

I’m needing to do this atm.

Yeah that’s too complex, can I just get the default one yet? :joy:

lol what, just gimmie a button for mirror cplane :sweat_smile: