Пример #1
0
        public bool getTFPlainFromBrepFace(out TFCOM.TFPlane tfPlain, TFCOM._TFFormRecipeList resipeList, TFCOM.TFdFaceLabel label)
        {
            TFCOM.TFBrepList brepList;
            resipeList.GetBrepList(out brepList, false, false, false);

            TFCOM.TFBrepFaceList faceList = brepList.GetFacesByLabel(label);

            //BCOM.Point3d center;
            //faceList.AsTFBrepFace.GetCenter(out center);

            //BCOM.Element faceElem;
            //faceList.GetElement(out faceElem, App.Transform3dIdentity());

            //TFCOM.TFPlane tfPlain;
            return(faceList.AsTFBrepFace.IsPlanar(out tfPlain));
            //{
            //    return true
            //}

            //if (!faceElem.IsPlanarElement())
            //{
            //    plane = new BCOM.Plane3d();
            //    return false;
            //}

            //var normal = faceElem.AsPlanarElement().Normal;

            //plane = new BCOM.Plane3d() {
            //    Normal = normal,
            //    Origin = center
            //};
            //return true;
        }
Пример #2
0
        public static BCOM.Plane3d ToPlane3d(this TFCOM.TFPlane tfPlane)
        {
            BCOM.Plane3d plane3D;
            BCOM.Point3d nor;
            tfPlane.GetVector(out plane3D.Origin, out nor);
            tfPlane.GetNormal(out plane3D.Normal);

            return(plane3D);
        }
Пример #3
0
        public static bool IsPlanarAndIntersectsElement(
            this TFCOM.TFBrepFace face, BCOM.Element element, out TFCOM.TFPlane tfPlane)
        {
            if (face.IsPlanar(out tfPlane))
            {
                //faceList.AsTFBrepFace.GetLabel(out faceLabel);
                BCOM.Point3d[] faceVerts;
                face.GetVertexLocations(out faceVerts);
                var faceShape = App.CreateShapeElement1(null, faceVerts);

                BCOM.Range3d result = new BCOM.Range3d();
                if (App.Range3dIntersect2(ref result, element.Range, faceShape.Range))
                {
                    return(true);
                }
            }
            return(false);
        }