Beispiel #1
0
        private static bool IsLargeRegion(Mesh3 region, Point3Tree <List <Polygon3> > edgeFacetIndex, double dimensionLength, double toleranceAngle)
        {
            bool           isLargeRegion  = false;
            List <Vector3> largeDiagonals = GetLargeDiagonals(GetBoundingVertices(region, edgeFacetIndex), dimensionLength);

            for (int i = 0; i != largeDiagonals.Count && !isLargeRegion; i++)
            {
                Vector3 diagonal1 = largeDiagonals[i];
                for (int j = i; j != largeDiagonals.Count && !isLargeRegion; j++)
                {
                    Vector3 diagonal2    = largeDiagonals[j];
                    double  angleBetween = AngleConverter.RadToDeg(Vector3.CalculateAngle(diagonal1, diagonal2));
                    if (angleBetween >= 90 - toleranceAngle && angleBetween <= 90 + toleranceAngle)
                    {
                        isLargeRegion = true;
                    }
                }
            }
            return(isLargeRegion);
        }
Beispiel #2
0
 private static bool DoesFacetNeedSupported(Polygon3 facet, double criticalAngle)
 {
     return(AngleConverter.RadToDeg(Vector3.CalculateAngle(facet.Normal, XYNormal)) > 180 - criticalAngle);
 }