You have basically answered your own question here. The RhinoScript function you’re using is dependent on the CPlane of the currently active Rhino viewport.
Here’s the code for the RhinoScript function you are calling:
def MirrorObject(object_id, start_point, end_point, copy=False):
"""Mirrors a single object
Parameters:
object_id (guid): The identifier of an object to mirror
start_point (point): start of the mirror plane
end_point (point): end of the mirror plane
copy (bool, optional): copy the object
Returns:
guid: Identifier of the mirrored object if successful
None: on error
Example:
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select object to mirror")
if obj:
start = rs.GetPoint("Start of mirror plane")
end = rs.GetPoint("End of mirror plane")
if start and end:
rs.MirrorObject( obj, start, end, True )
See Also:
MirrorObjects
"""
rc = MirrorObjects(object_id, start_point, end_point, copy)
if rc: return rc[0]
As you can see, it is just calling the function:
MirrorObjects(object_id, start_point, end_point, copy)
It’s code is here:
def MirrorObjects(object_ids, start_point, end_point, copy=False):
"""Mirrors a list of objects
Parameters:
object_ids ([guid, ...]): identifiers of objects to mirror
start_point (point): start of the mirror plane
end_point (point): end of the mirror plane
copy (bool, optional): copy the objects
Returns:
list(guid, ...): List of identifiers of the mirrored objects if successful
Example:
import rhinoscriptsyntax as rs
objs = rs.GetObjects("Select objects to mirror")
if objs:
start = rs.GetPoint("Start of mirror plane")
end = rs.GetPoint("End of mirror plane")
if start and end:
rs.MirrorObjects( objs, start, end, True )
See Also:
MirrorObject
"""
start_point = rhutil.coerce3dpoint(start_point, True)
end_point = rhutil.coerce3dpoint(end_point, True)
vec = end_point-start_point
if vec.IsTiny(0): raise Exception("start and end points are too close to each other")
normal = scriptcontext.doc.Views.ActiveView.ActiveViewport.ConstructionPlane().Normal
vec = Rhino.Geometry.Vector3d.CrossProduct(vec, normal)
vec.Unitize()
xf = Rhino.Geometry.Transform.Mirror(start_point, vec)
rc = TransformObjects(object_ids, xf, copy)
return rc
Pay attention to these lines:
normal = scriptcontext.doc.Views.ActiveView.ActiveViewport.ConstructionPlane().Normal
vec = Rhino.Geometry.Vector3d.CrossProduct(vec, normal)
vec.Unitize()
xf = Rhino.Geometry.Transform.Mirror(start_point, vec)
It is using the CPlane of the currently active Rhino viewport to calculate the normal vector of the mirror plane used in the transformation.
-Kevin