Hi, I’m writing a code to make duplicates of the input objects (Rhino.Geometry) and apply transformations in Python.
I initially thought the code can be generic, but it seems like there are different object types that provide different ways of duplicating objects.
It seems like some object has Duplicate(), and some object only has copy constructor (e.g., newP=rg.Point3d(P)). Also, some object types such as surfaces have specific functions such as DuplicateSrf().
My question is,
- what is the difference between Duplicate() and DuplicateSrf()?
- if I wrote a code like
if isinstance(obj,rg....):
newobj=rg.objtype(obj)
elif isinstance(obj,rg....):
newobj=obj.Duplicate()
How many base object types there are? Do I need to write if-else block for all the object types that only have copy constructors? It seems like Point3d and Vector3d fall into this class. Why they don’t have Duplicate()? What’s the best way to write a universal code to make a copy of all the object types provided by Rhino.Geometry?
Thank you.