We are writing an SDK for a CAD program and are faced with a little disagreement regarding a certain type of function (not just disagreements between different people, but also disagreement between my two halves of the brain).
Imagine that there are many classes for specific types of curve (ellipse, circle, arc, line, bezier, etc.). All of these classes can be represented by a Nurb curve. Therefore, we must put the Circle-> Nurbs function in a circle:
public NurbsCurve Circle.ToNurbsCurve()
{
// Return a circular NurbsCurve or null if the Circle is invalid.
}
or should be static on NurbsCurve:
public static NurbsCurve NurbsCurve.CreateFromCircle(Circle)
{
}
source
share