Example #1
0
        public SpacePoint FromStandardSpace(DPoint source)
        {
            StandardPoint   = source;
            SubclippedPoint = Space.ToSubclippedSpaceFromStandardSpace(StandardPoint);
            PriorPoint      = Space.ToPriorSpaceFromSubclippedSpace(SubclippedPoint);
            FramePoint      = Space.ToFrameSpaceFromSubclippedSpace(SubclippedPoint);

            ModelPoint = ModelSpace.ToStandardSpaceFromSubclippedSpace(ModelSpace.ToSubclippedSpaceFromPriorSpace(PriorPoint));

            return(this);
        }
Example #2
0
        public void ReadHullsFrame()
        {
            //Convert prior spaced hulls to frame space
            ConvexHullsFrame = ConvexHullsPrior.Keys.ToDictionary(k => k, v => new List <DPoint>());

            ConvexHullsPrior.Keys.ForEach(k =>
                                          ConvexHullsFrame[k].AddRange(ConvexHullsPrior[k].Select(pv =>
                                                                                                  Space.ToSubclippedSpaceFromPriorSpace(pv)
                                                                                                  ))
                                          );

            //Add standard space hulls
            ConvexHullsStandard = ConvexHullsPrior.Keys.ToDictionary(k => k, v => new List <DPoint>());

            ConvexHullsPrior.Keys.ForEach(k =>
                                          ConvexHullsStandard[k].AddRange(ConvexHullsFrame[k].Select(pv =>
                                                                                                     Space.ToStandardSpaceFromSubclippedSpace(pv)
                                                                                                     ))
                                          );

            //Find the proboscis base point
            var closestPts = ConvexHullsPrior[PointLabels.Proboscis]
                             .OrderByDescending(p => p.Y)
                             .Take(2)
                             .ToList();

            ProboscisHullBase = new SpacePoint(Space)
                                .FromPriorSpace
                                    (new WPoint(
                                        closestPts.Average(p => p.X),
                                        closestPts.Average(p => p.Y)
                                        ));
        }