thanks
In fact, my question is RefrenceType that after the Trancform (Move, Rotate…),What to do the primary clean object of ValueType
(Copy in C #) (in Python this problem is resolved with DeepCopy, but in the # c how? move &(copy)gh.gh (14.6 KB)
? must A!=B BUT A=B
var y = new List<Curve>();
y = c;
B = new List<Curve>(y);;
var x = Rhino.Geometry.Transform.Translation(gap);
c[0].Transform(x);
A = c;
private void RunScript(Surface surface, Vector3d direction, ref object A)
{
var brep = surface.ToBrep();
var line = new Line(Point3d.Origin, direction);
A = brep.Faces[0].CreateExtrusion(line.ToNurbsCurve(), true);
}
private void RunScript(Brep brep, Vector3d direction, ref object A)
{
A = ExtrudeBrep(brep, direction);
}
// <Custom additional code>
public static Brep ExtrudeBrep(Brep brep, Vector3d direction)
{
if(direction.IsZero) return brep;
var breps = new List<Brep>{brep};
foreach(BrepEdge edge in brep.Edges)
{
if(edge.TrimCount == 0) continue;
var crv = edge.DuplicateCurve();
var extrusion = Surface.CreateExtrusion(crv, direction);
if(extrusion == null) continue;
var b = extrusion.ToBrep();
b.Faces.SplitKinkyFaces();
breps.Add(b);
}
if(breps.Count == 1) return brep;
var cap = brep.DuplicateBrep();
cap.Translate(direction);
breps.Add(cap);
var result = Brep.JoinBreps(breps, 0.001);
return result == null ? brep : result[0];
}
// <Custom additional code>