Exemplo n.º 1
0
        /// <summary>
        /// Extend member by changing web axis start point. Adjust operations accordingly.
        /// </summary>
        /// <param name="newStartPoint"></param>
        internal void SetWebAxisStartPoint(Geo.Point newStartPoint)
        {
            // Create new axis
            Geo.Line newAxis = Geo.Line.ByStartPointEndPoint(newStartPoint, _webAxis.EndPoint);

            // Compute new locations for operations relative to new axis
            foreach (hOperation op in operations)
            {
                Geo.Point opPoint = _webAxis.PointAtParameter(op._loc / _webAxis.Length);
                double    newLoc  = newAxis.ParameterAtPoint(opPoint) * newAxis.Length;
                op._loc = newLoc;
            }

            // Set new axis
            _webAxis = newAxis;
        }
        internal void Setup()
        {
            _currentParameter = 0.5;

            Geo.Vector edgeVector = Geo.Vector.ByTwoPoints(_edge.StartPoint, _edge.EndPoint);
            _lineDirectionA = _faceNormalA.Cross(edgeVector);
            _lineDirectionB = (_isNaked) ? null : _faceNormalB.Cross(edgeVector);
            _lineA          = Geo.Line.ByStartPointDirectionLength(_edge.PointAtParameter(_currentParameter), _lineDirectionA, 1);
            _lineB          = (_isNaked) ? null : Geo.Line.ByStartPointDirectionLength(_edge.PointAtParameter(_currentParameter), _lineDirectionB, 1);

            _isFlat = (_isNaked) ? false : _faceNormalA.Normalized().Dot(_faceNormalB.Normalized()) == 1;
        }