private static ISolidEntity RevolveCore(DSCurve profile, DSPoint axisOrigin, DSVector axisDirection, double startAngle, double sweepAngle) { if (profile == null) { throw new ArgumentNullException("profile"); } if (axisOrigin == null) { throw new ArgumentNullException("axisOrigin"); } if (axisDirection == null) { throw new ArgumentNullException("axisDirection"); } if (!profile.IsPlanar) { throw new System.ArgumentException(string.Format(Properties.Resources.InvalidArguments, "profile"), "profile"); } if (DSGeometryExtension.Equals(axisDirection.Length, 0.0)) { throw new System.ArgumentException(string.Format(Properties.Resources.InvalidArguments, "axisDirection"), "axisDirection"); } if (DSGeometryExtension.Equals(sweepAngle, 0.0)) { throw new System.ArgumentException(string.Format(Properties.Resources.InvalidArguments, "sweepAngle"), "sweepAngle"); } ISolidEntity entity = HostFactory.Factory.SolidByRevolve(profile.CurveEntity, axisOrigin.PointEntity, axisDirection.IVector, startAngle, sweepAngle); if (entity == null) { throw new InvalidOperationException(string.Format(Properties.Resources.OperationFailed, "DSSolid.Revolve")); } return(entity); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool IsPerpendicular(DSVector other) { if (other == null) { throw new System.ArgumentNullException("other"); } var normalizedThis = Normalize(); var normalizedOther = other.Normalize(); var dotProd = normalizedThis.Dot(normalizedOther); return(DSGeometryExtension.Equals(Math.Abs(dotProd), 0.0)); }
internal static bool EqualsTo(this IPointEntity thisValue, IPointEntity value) { if (Object.ReferenceEquals(thisValue, value)) { return(true); } if (null == thisValue || null == value) { return(false); } return(DSGeometryExtension.Equals(thisValue.X, value.X) && DSGeometryExtension.Equals(thisValue.Y, value.Y) && DSGeometryExtension.Equals(thisValue.Z, value.Z)); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } DSVector vec = obj as DSVector; if (null == vec) { return(false); } return(DSGeometryExtension.Equals(vec.X, X) && DSGeometryExtension.Equals(vec.Y, Y) && DSGeometryExtension.Equals(vec.Z, Z)); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> protected override bool Equals(DesignScriptEntity obj) { if (base.Equals(obj)) { return(true); } var arc = obj as DSArc; if (arc == null) { return(false); } return(CenterPoint.Equals(arc.CenterPoint) && Normal.Equals(arc.Normal) && DSGeometryExtension.Equals(Radius, arc.Radius)); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> protected override bool Equals(DesignScriptEntity obj) { if (base.Equals(obj)) { return(true); } var other = obj as DSCircle; if (obj == null || other == null) { return(false); } return(CenterPoint.Equals(other.CenterPoint) && DSGeometryExtension.Equals(Radius, other.Radius) && Normal.Equals(other.Normal)); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> protected override bool Equals(DesignScriptEntity obj) { if (base.Equals(obj)) { return(true); } var pt = obj as DSPoint; if (pt == null) { return(false); } else { return(DSGeometryExtension.Equals(X, pt.X) && DSGeometryExtension.Equals(Y, pt.Y) && DSGeometryExtension.Equals(Z, pt.Z)); } }
internal bool IsZeroVector() { return(DSGeometryExtension.Equals(X, 0.0) && DSGeometryExtension.Equals(Y, 0.0) && DSGeometryExtension.Equals(Z, 0.0)); }
public static bool LessThanOrEqualTo(this Double thisValue, Double value) { return(thisValue < value || DSGeometryExtension.Equals(thisValue, value)); }
public static bool EqualsTo(this Double thisValue, Double value) { return(DSGeometryExtension.Equals(thisValue, value)); }