public override Value Evaluate(FSharpList <Value> args) { Curve pathCurve = (Curve)((Value.Container)args[0]).Item; Curve crossSection = (Curve)((Value.Container)args[1]).Item; _solid = crossSection.sweep_as_solid(pathCurve); GraphicItem.persist(_solid); return(Value.NewContainer(_solid)); }
public override Value Evaluate(FSharpList <Value> args) { Surface surf = (Surface)((Value.Container)args[0]).Item; double dist = ((Value.Number)args[1]).Item; _solid = surf.thicken(dist); GraphicItem.persist(_solid); return(Value.NewContainer(_solid)); }
public override Value Evaluate(FSharpList <Value> args) { Curve curve = (Curve)((Value.Container)args[0]).Item; double dist = ((Value.Number)args[1]).Item; _point = curve.point_at_distance(dist); GraphicItem.persist(_point); _graphicItems.Add(_point); return(Value.NewContainer(_point)); }
public override Value Evaluate(FSharpList <Value> args) { Surface surf = (Surface)((Value.Container)args[0]).Item; double u = ((Value.Number)args[1]).Item; double v = ((Value.Number)args[2]).Item; _point = surf.point_at_parameter(u, v); GraphicItem.persist(_point); return(Value.NewContainer(_point)); }
public override Value Evaluate(FSharpList <Value> args) { Curve curve = (Curve)((Value.Container)args[0]).Item; Vector dir = (Vector)((Value.Container)args[1]).Item; double dist = ((Value.Number)args[2]).Item; _surface = curve.extrude(dir, dist); GraphicItem.persist(_surface); return(Value.NewContainer(_surface)); }
public override Value Evaluate(FSharpList <Value> args) { Geometry geom1 = (Geometry)((Value.Container)args[0]).Item; Geometry geom2 = (Geometry)((Value.Container)args[1]).Item; GeometryList result = geom1.intersect(geom2); foreach (Geometry g in _result) { GraphicItem.unpersist(g); } _result.Clear(); foreach (Geometry g in result) { Geometry restored = RestoreProperType(g); GraphicItem.persist(restored); _result.Add(restored); _graphicItems.Add(restored); } if (_result.Count == 1) { return(Value.NewContainer(_result[0])); } else { List <Value> return_values = new List <Value>(); foreach (Geometry g in _result) { return_values.Add(Value.NewContainer(g)); } return(Value.NewList(Utils.SequenceToFSharpList(return_values))); } }
public override Value Evaluate(FSharpList <Value> args) { DSObject item = (DSObject)((Value.Container)args[0]).Item; Vector v = (Vector)((Value.Container)args[1]).Item; DSObject cloned = item.clone(); _transformableItem = RestoreProperDSType(cloned) as TransformableItem; // TODO: throw exception if not transformable item _transformableItem.translate(v.x(), v.y(), v.z()); GraphicItem graphicItem = _transformableItem as GraphicItem; if (graphicItem != null) { GraphicItem.persist(graphicItem); } return(Value.NewContainer(_transformableItem)); }