コード例 #1
0
        //public static ApertureEntity TryGetFrom(RhinoObject obj)
        //{
        //    return TryGetFrom(obj.Geometry);
        //}

        public new static ApertureEntity TryGetFrom(Rhino.Geometry.GeometryBase rhinoGeo)
        {
            var rc = new ApertureEntity();

            if (rhinoGeo == null)
            {
                return(rc);
            }
            if (!rhinoGeo.IsValid)
            {
                return(rc);
            }

            var ent = rhinoGeo.UserData.Find(typeof(ApertureEntity)) as ApertureEntity;

            return(ent == null ? rc : ent);
        }
コード例 #2
0
 public static ApertureEntity TryGetApertureEntity(this GeometryBase rhinoRef) => ApertureEntity.TryGetFrom(rhinoRef);
コード例 #3
0
 public static ApertureEntity TryGetApertureEntity(this ObjRef rhinoRef) => ApertureEntity.TryGetFrom(rhinoRef.Geometry());
コード例 #4
0
 public static bool IsAperture(this GeometryBase geometry) => ApertureEntity.TryGetFrom(geometry).IsValid;