public void makeRevolvedSurface(AbstractLineSegment attachedLine, Vector3 revPoint, Vector3 normDir) { #region intialize a cylinder, cone or conic /etc. InteractablePoint newPoint = InteractablePoint.Constructor(); newPoint.Position3 = revPoint; //nullreference on this line from shipswheel DependentRevolvedSurface drs = GeoObjConstruction.dRevSurface(newPoint.GetComponent <AbstractPoint>(), attachedLine, normDir); HW_GeoSolver.ins.AddDependence(drs, newPoint); HW_GeoSolver.ins.AddDependence(drs, attachedLine.GetComponent <MasterGeoObj>()); #endregion }
public static DependentRevolvedSurface dRevSurface(AbstractPoint center, AbstractLineSegment attachedLineSegment, Vector3 normDir) { DependentRevolvedSurface drs = DependentRevolvedSurface.Constructor(); drs.transform.parent = attachedLineSegment.transform.parent; drs.attachedLine = attachedLineSegment; drs.endpoint1 = attachedLineSegment.vertex0; drs.endpoint2 = attachedLineSegment.vertex1; drs.normalDirection = normDir; drs.centerPoint = center.Position3; drs.center = center; HW_GeoSolver.ins.AddDependence(drs, center); HW_GeoSolver.ins.AddDependence(drs, attachedLineSegment); drs.InitializeFigure(); return(drs); }