public IOrientableCurve Morph(SpaceMorph xmorph) { var curve = Curve.DuplicateCurve(); xmorph.Morph(curve); return(Create(curve)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { var dup = this.m_value.Duplicate(); xmorph.Morph(dup); return(new GH_PointCloud((PointCloud)dup)); }
/// <summary> /// /// </summary> /// <param name="xmorph"></param> /// <returns></returns> public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { var copy = Value.Duplicate(); // TODO check if need to copy before transform? copy.SpaceMorph(xmorph); return(new GH_HeMesh3d(copy)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { var copy = Value.Duplicate(); xmorph.Morph(copy.Geometry); return(new GH_DisplayGeometry(copy)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { Mesh m = Value.DuplicateMesh(); xmorph.Morph(m); return(new ResultMesh(m, m_results)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.PolyCurve == null) { return(null); } GsaMember1d mem = new GsaMember1d { Member = Value.Member }; List <Point3d> pts = Value.Topology; for (int i = 0; i < pts.Count; i++) { pts[i] = xmorph.MorphPoint(pts[i]); } mem.Topology = pts; if (Value.PolyCurve != null) { PolyCurve crv = Value.PolyCurve.DuplicatePolyCurve(); xmorph.Morph(crv); mem.PolyCurve = crv; } return(new GsaMember1dGoo(mem)); }
public IOrientableCurve Morph(SpaceMorph xmorph) { var surface = (Surface)Surface.Duplicate(); xmorph.Morph(surface); return(Create(surface, Curve)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { Point3d start = xmorph.MorphPoint(Value.From); Point3d end = xmorph.MorphPoint(Value.To); Line ln = new Line(start, end); return(new ResultLine(ln, m_result1, m_result2, m_colour1, m_colour2, m_size1, m_size2)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { var dup = this.DuplicateGeometry() as GS_StructuralArea; xmorph.Morph(dup.Value); return(dup); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { var dup = this.DuplicateGeometry() as GS_PointLoad; xmorph.Morph(dup.Value); return(dup); }
//no idea if they work public override Grasshopper.Kernel.Types.IGH_GeometricGoo Morph(SpaceMorph xmorph) { for (int i = 0; i < this.Value.Nodes.Count; i++) { this.Value.Nodes[i] = xmorph.MorphPoint(this.Value.Nodes[i]); } return(this); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { GH_Spring nc = this.DuplicateGeometry() as GH_Spring; if (nc.Value.IsACurve) { xmorph.Morph(nc.Value.CurveA); } else { xmorph.Morph(nc.Value.PointA); } return(nc); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.Halfedges.Count < 1) { return(null); } // TODO: cast to Rhino.Geometry.Mesh Rhino.Geometry.Mesh mesh; CastTo <Rhino.Geometry.Mesh>(out mesh); xmorph.Morph(mesh); return(new GH_Mesh(mesh)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.Plane == null) { return(null); } GsaGridPlaneSurface dup = Value.Duplicate(); Plane pln = dup.Plane; xmorph.Morph(ref pln); GsaGridPlaneSurface gridplane = new GsaGridPlaneSurface(pln); return(new GsaGridPlaneSurfaceGoo(gridplane)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.Point == null) { return(null); } Point3d pt = Value.Point; pt = xmorph.MorphPoint(pt); GsaNode node = new GsaNode(pt); return(new GsaNodeGoo(node)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } var copy = Value.Duplicate(); var pointCloud = new Rhino.Geometry.PointCloud(copy.ToPoint3dArray()); xmorph.Morph(pointCloud); for (int i = 0; i < Value.Nodes.Count; i++) { copy.Nodes[i].X = pointCloud[i].Location.X; copy.Nodes[i].Y = pointCloud[i].Location.Y; copy.Nodes[i].Z = pointCloud[i].Location.Z; } return(new MolecularGoo(copy)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.SolidMesh == null) { return(null); } GsaMember3d elem = Value.Duplicate(); Mesh xMs = elem.SolidMesh; xmorph.Morph(xMs); elem.SolidMesh = xMs; return(new GsaMember3dGoo(elem)); }
//this is for morphing - dont even know what it is, but I dont have to public GeomObject Morph(SpaceMorph morph) { GeomObject mObj = Duplicate(); foreach (string key in mObj.MemberDict.Keys) { List <IGH_Goo> newData = new List <IGH_Goo>(); for (int i = 0; i < mObj.MemberDict[key].Count; i++) { if (typeof(IGH_GeometricGoo).IsAssignableFrom(mObj.MemberDict[key][i].GetType())) { IGH_GeometricGoo geom = (IGH_GeometricGoo)mObj.MemberDict[key][i]; mObj.MemberDict[key][i] = geom.Morph(morph); } } } return(mObj); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.Line == null) { return(null); } GsaElement1d elem = Value.Duplicate(); LineCurve xLn = Value.Line; xmorph.Morph(xLn); elem.Line = xLn; return(new GsaElement1dGoo(elem)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.Point == null) { return(null); } GsaNode node = Value.Duplicate(); Point3d pt = node.Point; pt = xmorph.MorphPoint(pt); node.Point = pt; return(new GsaNodeGoo(node)); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.NgonMesh == null) { return(null); } GsaElement3d elem = Value.Duplicate(); Mesh xMs = elem.NgonMesh; xmorph.Morph(xMs); elem.NgonMesh = xMs; elem.TopoInt = Value.TopoInt; elem.Topology = Value.Topology; return(new GsaElement3dGoo(elem)); }
/*******************************************/ public IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (m_RhinoGeometry == null) { return(null); } else if (m_RhinoGeometry is Point3d) { Point3d morphed = xmorph.MorphPoint((Rhino.Geometry.Point3d)m_RhinoGeometry); return(new GH_IBHoMGeometry { Value = morphed.FromRhino() }); } else { GeometryBase geometry = ((GeometryBase)m_RhinoGeometry).Duplicate(); xmorph.Morph(geometry); return(new GH_IBHoMGeometry { Value = geometry?.IFromRhino() }); } }
/// <summary> /// /// </summary> /// <typeparam name="V"></typeparam> /// <typeparam name="E"></typeparam> /// <param name="graph"></param> /// <param name="xmorph"></param> /// <param name="parallel"></param> public static void SpaceMorph <V, E>(this HeStructure <V, E> graph, SpaceMorph xmorph, bool parallel = false) where V : HeVertex <V, E>, IPosition3d where E : Halfedge <V, E> { var verts = graph.Vertices; if (parallel) { Parallel.ForEach(Partitioner.Create(0, verts.Count), range => Body(range.Item1, range.Item2)); } else { Body(0, verts.Count); } void Body(int from, int to) { for (int i = from; i < to; i++) { var v = verts[i]; v.Position = xmorph.MorphPoint(v.Position); } } }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.Mesh == null) { return(null); } GsaElement2d elem = new GsaElement2d { Elements = Value.Elements }; Mesh xMs = Value.Mesh; xmorph.Morph(xMs); elem.Mesh = xMs; elem.TopoInt = Value.TopoInt; elem.Topology = Value.Topology; return(new GsaElement2dGoo(elem)); }
/// <summary> /// /// </summary> /// <typeparam name="V"></typeparam> /// <typeparam name="E"></typeparam> /// <param name="graph"></param> /// <param name="xmorph"></param> /// <param name="parallel"></param> public static void SpaceMorph <V, E>(this IHeStructure <V, E> graph, SpaceMorph xmorph, bool parallel = false) where V : HeElement, IHeVertex <V, E>, IVertex3d where E : HeElement, IHalfedge <V, E> { var verts = graph.Vertices; Action <Tuple <int, int> > body = range => { for (int i = range.Item1; i < range.Item2; i++) { var v = verts[i]; v.Position = xmorph.Apply(v.Position); } }; if (parallel) { Parallel.ForEach(Partitioner.Create(0, verts.Count), body); } else { body(Tuple.Create(0, verts.Count)); } }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { if (Value == null) { return(null); } if (Value.Brep == null & Value.PolyCurve == null) { return(null); } GsaMember2d mem = new GsaMember2d { Member = Value.Member }; List <Point3d> pts = Value.Topology; for (int i = 0; i < pts.Count; i++) { pts[i] = xmorph.MorphPoint(pts[i]); } mem.Topology = pts; if (Value.VoidTopology != null) { for (int i = 0; i < Value.VoidTopology.Count; i++) { pts = Value.VoidTopology[i]; for (int j = 0; j < pts.Count; j++) { pts[j] = xmorph.MorphPoint(pts[j]); } mem.VoidTopology.Add(pts); } mem.VoidTopologyType = Value.VoidTopologyType; } if (Value.InclusionLines != null) { for (int i = 0; i < Value.InclusionLines.Count; i++) { PolyCurve xLn = Value.InclusionLines[i]; xmorph.Morph(xLn); mem.InclusionLines.Add(xLn); } for (int i = 0; i < Value.IncLinesTopology.Count; i++) { pts = Value.IncLinesTopology[i]; for (int j = 0; j < pts.Count; j++) { pts[j] = xmorph.MorphPoint(pts[j]); } mem.IncLinesTopology.Add(pts); } mem.IncLinesTopologyType = Value.IncLinesTopologyType; } if (Value.InclusionPoints != null) { pts = Value.InclusionPoints; for (int i = 0; i < pts.Count; i++) { pts[i] = xmorph.MorphPoint(pts[i]); } mem.InclusionPoints = pts; } if (Value.Brep != null) { Brep brep = Value.Brep.DuplicateBrep(); xmorph.Morph(brep); mem.Brep = brep; } if (Value.PolyCurve != null) { PolyCurve crv = Value.PolyCurve.DuplicatePolyCurve(); xmorph.Morph(crv); mem.PolyCurve = crv; } return(new GsaMember2dGoo(mem)); }
/// <summary> /// /// </summary> /// <param name="xmorph"></param> /// <param name="vector"></param> /// <returns></returns> public static Vec3d Apply(this SpaceMorph xmorph, Vec3d vector) { return(xmorph.MorphPoint(vector)); }
/// <summary> /// morph the object or a deformable representation of the object /// </summary> /// <param name="xmorph">spatial deform</param> /// <returns>deformed geometry</returns> public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { throw new NotImplementedException(); }
/// <summary> /// Morph the object or a deformable representation of the object. /// </summary> /// <param name="xmorph"> Spatial deform. </param> /// <returns> Deformed geometry. If the local geometry can be deformed accurately, then the returned /// instance equals this instance. Not all geometry types can be accurately deformed though, if /// this is the case, this function will return an instance of another IGH_GeometricGoo derived /// type which can be deformed.</returns> public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { return(null); }
public override IGH_GeometricGoo Morph(SpaceMorph xmorph) { return(base.m_value.Item2.Morph(xmorph)); }
internal static extern bool ON_SpaceMorph_MorphGeometry(IntPtr pConstGeometry, double tolerance, [MarshalAs(UnmanagedType.U1)]bool quickpreview, [MarshalAs(UnmanagedType.U1)]bool preserveStructure, SpaceMorph.MorphPointCallback callback);