Object Duplicate is NOT a real copy

This:

Transform mirrorTransform = Transform.Mirror(Plane.WorldZX);
GeometryBase mirroredGeometry = rhobj.Geometry.Duplicate();
mirroredGeometry.Transform(mirrorTransform);
Is not really creating a copy, or at least creates a modified copy of the original object!


How is possible as it saying FULLY geometry copy??

How much different are the coordinates?

Also, share the 3dm with the geometry you are testing with.

The object on the right is the original one, on the left the copy. Do you see tfrom the picture that a sirface was splitted in two?

1 Like

Sure, but I am unable to reproduce here locally. Share a 3dm file that you are doing this with so we can investigate.

CopyNotCopy.3dm (1.9 MB)

Here the file with the object

@nathanletwory
I can confirm the Brep is changed even without a transformation:

import rhinoscriptsyntax as rs
import scriptcontext as sc

for obj_id in rs.SelectedObjects():
    geom = rs.coercegeometry(obj_id)
    sc.doc.Objects.AddBrep(geom)
  • Willem

Gumball Extrude and normal surface extrude also splits the surface. I wonder how the original shape was created…

The original surface has a crease of 1.56 degrees, and is being split at the crease. The knots in the U direction are partial multi-knots.

1 Like

Hi @sartoriedo,

Your source Brep has kinks.

Because kinked surfaces can cause problems down stream, Rhino always splits kinked surfaces when adding Breps to the document.

However, it is possible to add kinky Breps to Rhino.

#! python3
import Rhino
import scriptcontext as sc

def TestMirrorPolysurface():
    types = Rhino.DocObjects.ObjectType.PolysrfFilter
    rc, objref = Rhino.Input.RhinoGet.GetOneObject("Select polysurface to mirror", False, types)
    if rc != Rhino.Commands.Result.Success:
        return

    brep_obj = objref.Object()
    brep = objref.Brep()
    if not brep_obj or not brep:
        return

    xform  = Rhino.Geometry.Transform.Mirror(Rhino.Geometry.Plane.WorldZX)

    brep_copy = brep.Duplicate()
    brep_copy.Transform(xform)

    splitKinkySurfaces = False
    sc.doc.Objects.AddBrep(brep_copy, brep_obj.Attributes, None, False, splitKinkySurfaces)

    sc.doc.Views.Redraw

if __name__ == '__main__':
    TestMirrorPolysurface()

– Dale

3 Likes

Thanks Dale, I’ll test and let you know asap

As you suggested is working, thank you.
Maybe can be good to add this detail in the documentation because is important when working with objects, as is stating full copy the expectation are like have a real copy, or set the kinksplit false as default.
At least now there’s a post about this, hope it will be usefull.

Was created using boolean splits or difference