Ejemplo n.º 1
0
 public void init( Vec2 _v1, Vec2 _v2 )
 {
     v1 = _v1;
     v2 = _v2;
     origin = v1;
     direction = v2 - v1;
     distance = direction.normalize();
 }
Ejemplo n.º 2
0
        public bool extendToInfinite( Line2 other )
        {
            double[] constants = new double[ 2 ];
            Vec2 result = new Vec2( 0, 0 );
            if( intersectInfiniteInternal( other, ref result, ref constants ) == false )
                return false;

            if( constants[ 0 ] > 1 )
            {
                init( v1, result );
                return true;
            }

            if( constants[ 0 ] < 0 )
            {
                init( result, v2 );
                return true;
            }

            return false;
        }
Ejemplo n.º 3
0
 public void DrawArc( string strLayer, Vec2 vCentre, double dRadius, double dStartAngle, double dEndAngle )
 {
     //dEndAngle = 270;
     try
     {
         double left = calcX( vCentre.x - dRadius );
         double top = calcY( vCentre.y + dRadius );
         double right = calcX( vCentre.x + dRadius );
         double bottom = calcY( vCentre.y - dRadius );
         RectangleF rect = new RectangleF( ( float )left, ( float )top, ( float )( right - left ), ( float )( bottom - top ) );
         m_g.DrawArc( m_pens[ strLayer ], rect, -( float )dStartAngle, -( float )angleDiff( dStartAngle, dEndAngle ) );
     }
     catch( System.Exception e )
     {
         System.Diagnostics.Debug.WriteLine( "Exception: " + e.Message );
     }
 }
Ejemplo n.º 4
0
 Vec2 interpolate( double factor, Vec2 a, Vec2 b )
 {
     return a + ( b - a ) * factor;
 }
Ejemplo n.º 5
0
 void DrawSaddle( Drawer d, Vec2 vIntonationPoint )
 {
     if( m_currentSaddlePrefab != null )
         d.DrawPrefab( vIntonationPoint, m_currentSaddlePrefab );
 }
Ejemplo n.º 6
0
 public bool intersectInfinite( Line2 other, ref Vec2 result )
 {
     double[] constants = new double[ 2 ];
     return intersectInfiniteInternal( other, ref result, ref constants );
 }
Ejemplo n.º 7
0
        public bool trimToInfinite( Line2 other, Vec2 sideToKeep )
        {
            // trim to or extend to another
            double[] constants = new double[ 2 ];
            Vec2 intersectionPoint = new Vec2( 0, 0 );
            if( intersectInfiniteInternal( other, ref intersectionPoint, ref constants ) == false )
                return false;

            // extending to another
            if( constants[ 0 ] > 1 )
            {
                init( v1, intersectionPoint );
                return true;
            }

            if( constants[ 0 ] < 0 )
            {
                init( intersectionPoint, v2 );
                return true;
            }

            // trimming to another
            //print( "trimToInfinite gave constant of %.3f" % constants[ 0 ])
            Vec2 deltaToV1 = v1 - intersectionPoint;
            Vec2 deltaToV2 = v2 - intersectionPoint;
            Vec2 deltaToSide = intersectionPoint;
            if( deltaToV1.dot( sideToKeep ) > 0 )
            {
                init( v1, intersectionPoint );
                //print( "   trimmed back in the direction of v1" )
                return true;
            }

            if( deltaToV2.dot( sideToKeep ) > 0 )
            {
                init( intersectionPoint, v2 );
                //print( "   trimmed back in the direction of v2" )
                return true;
            }
            return false;
        }
Ejemplo n.º 8
0
        public Line2 perpendicular( Vec2 direction )
        {
            // return a normal vector from this line, generally pointing in the direction provided
            Vec2 normal = new Vec2( -direction.y, direction.x );

            double directionality = normal.dot( direction );
            if( directionality >= 0 )
                return new Line2( v1, v1 + normal * distance );
            else
                return new Line2( v1, v1 - normal * distance );
        }
Ejemplo n.º 9
0
 public void DrawCircle( string strLayer, Vec2 vCentre, double dRadius )
 {
     Circle c = new Circle( new Vector3d( vCentre.x, vCentre.y, 0 ), dRadius );
     c.Layer = m_layers[ strLayer ];
     m_dxf.AddEntity( c );
 }
Ejemplo n.º 10
0
 public void DrawArc( string strLayer, Vec2 vCentre, double dRadius, double dStartAngle, double dEndAngle )
 {
     Arc a = new Arc( new Vector3d( vCentre.x, vCentre.y, 0 ), dRadius, dStartAngle, dEndAngle );
     a.Layer = m_layers[ strLayer ];
     m_dxf.AddEntity( a );
 }
Ejemplo n.º 11
0
        public void Zoom( double dFactor, Vec2 vUIFocus )
        {
            // zoom so that the focus stays stationary
            // so we need to scroll while we zoom, in effect
            double dOldMSFocusX = uncalcX( vUIFocus.x );
            double dOldMSFocusY = uncalcY( vUIFocus.y );
            //m_vScroll.x += ( vUIFocus.x - m_rect.Width / 2 ) * m_fXScale;
            m_dZoom *= dFactor;
            if( m_dZoom < 0.000001 )
                m_dZoom = 0.000001;
            else if( m_dZoom > 100000 )
                m_dZoom = 100000;
            double dMSFocusX = uncalcX( vUIFocus.x );
            double dMSFocusY = uncalcY( vUIFocus.y );

            m_vScroll.x -= ( dOldMSFocusX - dMSFocusX );
            m_vScroll.y += ( dOldMSFocusY - dMSFocusY );
        }
Ejemplo n.º 12
0
 public void Scroll( Vec2 vUIOffset )
 {
     m_vScroll.x += vUIOffset.x / ( m_fXScale * m_dZoom );
     m_vScroll.y -= vUIOffset.y / ( m_fYScale * m_dZoom );
 }
Ejemplo n.º 13
0
 public void ResetView( Vec2 vCentre, double dZoom )
 {
     m_vScroll.x = -vCentre.x;
     m_vScroll.y = vCentre.y;
     m_dZoom = dZoom;
 }
Ejemplo n.º 14
0
 public void DrawEllipseArc( string strLayer, Vec2 majorAxisV1, Vec2 majorAxisV2, double minorAxisFactor, Vec2 vArcStart, Vec2 vArcEnd )
 {
     //RectangleF rect;
     //rect.Left = Math.Min( majorAxisV1.x
     //m_g.DrawArc( m_pens[ strLayer ]
 }
Ejemplo n.º 15
0
 public void DrawCircle( string strLayer, Vec2 vCentre, double dRadius )
 {
     try
     {
         double left = calcX( vCentre.x - dRadius );
         double top = calcY( vCentre.y + dRadius );
         double right = calcX( vCentre.x + dRadius );
         double bottom = calcY( vCentre.y - dRadius );
         RectangleF rect = new RectangleF( ( float )left, ( float )top, ( float )( right - left ), ( float )( bottom - top ) );
         m_g.DrawEllipse( m_pens[ strLayer ], rect );
     }
     catch
     {
     }
 }
Ejemplo n.º 16
0
        public bool intersectSegment( Line2 other, ref Vec2 result )
        {
            double[] constants = new double[ 2 ];
            if( intersectInfiniteInternal( other, ref result, ref constants ) == false )
                return false;

            if( constants[ 0 ] < 0 || constants[ 0 ] > 1 || constants[ 1 ] < 0 || constants[ 1 ] > 1 )
                return false;

            return true;
        }
Ejemplo n.º 17
0
        public Line2 offset( double distance, Vec2 direction )
        {
            // make a normal vector
            Vec2 normal = new Vec2( -this.direction.y, this.direction.x );

            // make sure its in the same direction as the direction hint vector
            if( normal.dot( direction ) < 0.0 )
                normal = normal * -1;

            // now create an offset line
            Vec2 offset = normal * distance;
            return new Line2( v1 + offset, v2 + offset );
        }
Ejemplo n.º 18
0
 public void DrawEllipseArc( string strLayer, Vec2 majorAxisV1, Vec2 majorAxisV2, double minorAxisFactor, Vec2 vArcStart, Vec2 vArcEnd )
 {
     //		Ellipse e = new Ellipse();
     //		e.Rotation
 }
Ejemplo n.º 19
0
        public Vec2 projection( Vec2 point )
        {
            // return the projection of point onto this line
            // make a normal vector from the mirror line
            Vec2 normal = new Vec2( -direction.y, direction.x );

            double normalDist = ( point - v1 ).dot( normal );
            return point - normal * normalDist;
        }
Ejemplo n.º 20
0
 public void DrawLine( string strLayer, Vec2 a, Vec2 b )
 {
     DrawLine( strLayer, a.x, a.y, b.x, b.y );
 }
Ejemplo n.º 21
0
 public Line2( Vec2 _v1, Vec2 _v2 )
 {
     init( new Vec2( _v1.x, _v1.y ), new Vec2( _v2.x, _v2.y ) );
 }
Ejemplo n.º 22
0
        public void DrawPrefab( Vec2 vPosition, DxfDocument prefab )
        {
            foreach( Line line in prefab.Lines )
                DrawLine( line.Layer.Name, line.StartPoint.X + vPosition.x, line.StartPoint.Y + vPosition.y, line.EndPoint.X + vPosition.x, line.EndPoint.Y + vPosition.y );

            foreach( Circle circle in prefab.Circles )
                DrawCircle( circle.Layer.Name, new Vec2( circle.Center.X + vPosition.x, circle.Center.Y + vPosition.y ), circle.Radius );

            foreach( Arc arc in prefab.Arcs )
                DrawArc( arc.Layer.Name, new Vec2( arc.Center.X + vPosition.x, arc.Center.Y + vPosition.y ), arc.Radius, arc.StartAngle, arc.EndAngle );
        }
Ejemplo n.º 23
0
 private void m_drawingBox_MouseMove( object sender, MouseEventArgs e )
 {
     if( m_bMouseDown )
     {
         Vec2 vNewMousePos = new Vec2( e.X, e.Y );
         Vec2 vDiff = vNewMousePos - m_vMouseMoveStart;
         m_graphicsDrawer.SetUIRect( m_drawingBox.DisplayRectangle );
         m_graphicsDrawer.Scroll( vDiff );
         m_vMouseMoveStart = vNewMousePos;
         m_drawingBox.Refresh();
     }
 }
Ejemplo n.º 24
0
 public double angleBetween( Vec2 other )
 {
     return Math.Acos( dot( other ) );
 }
Ejemplo n.º 25
0
        //def __repr__( self ):
        //    return "v1" + repr( v1 ) + " v2" + repr( v2 ) + " origin" + repr( origin ) + " direction" + repr( direction ) + " distance %.5f" % distance
        public bool intersectInfiniteInternal( Line2 other, ref Vec2 result, ref double[] constants )
        {
            double x1 = v1.x;
            double y1 = v1.y;
            double x2 = v2.x;
            double y2 = v2.y;
            double x3 = other.v1.x;
            double y3 = other.v1.y;
            double x4 = other.v2.x;
            double y4 = other.v2.y;

            double determinant = ( y4 - y3 ) * ( x2 - x1 ) - ( x4 - x3 ) * ( y2 - y1 );
            if( determinant == 0 )
                return false;

            constants[ 0 ] = ( ( x4 - x3 ) * ( y1 - y3 ) - ( y4 - y3 ) * ( x1 - x3 ) ) / determinant;
            constants[ 1 ] = ( ( x2 - x1 ) * ( y1 - y3 ) - ( y2 - y1 ) * ( x1 - x3 ) ) / determinant;

            result.x = x1 + constants[ 0 ] * ( x2 - x1 );
            result.y = y1 + constants[ 0 ] * ( y2 - y1 );

            return true;
        }
Ejemplo n.º 26
0
 public double distanceTo( Vec2 other )
 {
     return ( other - this ).length();
 }
Ejemplo n.º 27
0
 void DrawSaddleScrew( Drawer d, Vec2 vIntonationPoint )
 {
     if( m_eSaddleStyle == SaddleStyles.Hardtail )
     {
         d.DrawLine( "SaddleScrews", new Vec2( vIntonationPoint.x - 27, vIntonationPoint.y + 1.45 ), new Vec2( vIntonationPoint.x - 11.4, vIntonationPoint.y + 1.45 ) );
         d.DrawLine( "SaddleScrews", new Vec2( vIntonationPoint.x - 27, vIntonationPoint.y - 1.45 ), new Vec2( vIntonationPoint.x - 11.4, vIntonationPoint.y - 1.45 ) );
         d.DrawLine( "SaddleScrews", new Vec2( vIntonationPoint.x - 11.4, vIntonationPoint.y + 1.45 ), new Vec2( vIntonationPoint.x - 11.4, vIntonationPoint.y - 1.45 ) );
         d.DrawLine( "SaddleScrews", new Vec2( vIntonationPoint.x - 27, vIntonationPoint.y + 2.65 ), new Vec2( vIntonationPoint.x - 27, vIntonationPoint.y - 2.65 ) );
         d.DrawLine( "SaddleScrews", new Vec2( vIntonationPoint.x - 27, vIntonationPoint.y + 2.65 ), new Vec2( vIntonationPoint.x - 27, vIntonationPoint.y - 2.65 ) );
         d.DrawLine( "SaddleScrews", new Vec2( vIntonationPoint.x - 28.73, vIntonationPoint.y + 2.65 ), new Vec2( vIntonationPoint.x - 28.73, vIntonationPoint.y - 2.65 ) );
         d.DrawLine( "SaddleScrews", new Vec2( vIntonationPoint.x - 27, vIntonationPoint.y + 2.65 ), new Vec2( vIntonationPoint.x - 28.73, vIntonationPoint.y + 2.65 ) );
         d.DrawLine( "SaddleScrews", new Vec2( vIntonationPoint.x - 27, vIntonationPoint.y - 2.65 ), new Vec2( vIntonationPoint.x - 28.73, vIntonationPoint.y - 2.65 ) );
     }
 }
Ejemplo n.º 28
0
 public double dot( Vec2 other )
 {
     return x * other.x + y * other.y;
 }
Ejemplo n.º 29
0
        //---------------------------------------------------------------------
        public void Draw( Drawer d )
        {
            d.AddLayer( "Scale", Color.FromArgb( 255, 255, 255, 255 ) );
            d.AddLayer( "FretCentres", Color.FromArgb( 255, 0, 192, 192 ) );
            d.AddLayer( "Fretwire", Color.FromArgb( 255, 192, 192, 192 ) );
            d.AddLayer( "StringCenterLines", Color.FromArgb( 255, 255, 255, 255 ) );
            d.AddLayer( "Strings", Color.FromArgb( 255, 255, 255, 255 ) );
            d.AddLayer( "FretBoard", Color.FromArgb( 255, 255, 255, 255 ) );
            d.AddLayer( "Saddles", Color.FromArgb( 255, 255, 255, 0 ) );
            d.AddLayer( "SaddleScrews", Color.FromArgb( 255, 255, 192, 0 ) );

            // find out what strings we need
            double[] stringWidths = new double[ m_iStringCount ];
            double[] stringCompensations = new double[ m_iStringCount ];
            for( int i = 0; i < m_iStringCount; ++i )
            {
                double dResultantTension = 0;
                StringInfo s = GetIdealString( i, ref dResultantTension );
                stringWidths[ i ] = s.m_dDiameter * 25.4;
                stringCompensations[ i ] = GetRequiredCompensation( i, m_dStringHeightAt12th );
            }

            RectangleF extents = RoughExtents;
            double fMaxScale = Math.Max( m_fBassScaleLength, m_fTrebleScaleLength );

            d.SetLimits( extents.Left, extents.Top, extents.Right, extents.Bottom );

            // draw centreline & lines showing the scale points for the two scales
            d.DrawLine( "Scale", -30, 0, fMaxScale + 30, 0 );
            //	d.DrawLine( "Scale", 0, TotalBridgeStringSpacing / 2 + 30, 0, -TotalBridgeStringSpacing / 2 - 30 );
            //	if( m_fBassScaleLength != m_fTrebleScaleLength )
            //		d.DrawLine( "Scale", scaleTrebleOffset, TotalBridgeStringSpacing / 2 + 30, scaleTrebleOffset, -TotalBridgeStringSpacing / 2 - 30 );

            // find fret locations
            Line2[] fretLines = new Line2[ m_iFretCount + 1 ];
            for( int i = 0; i < m_iFretCount + 1; ++i )
            {
                fretLines[ i ] = GetFretLine( i );
            }
            /*
            # do constant-spacing based string spacing, to take each string's thickness into account
            #spacingLeft = TotalNutStringSpacing + stringWidths[ 0 ] / 2 + stringWidths[ stringCount - 1 ] / 2
            #for i in range( stringCount ):
            #    spacingLeft -= stringWidths[ i ]
            #spacingBetweenStrings = spacingLeft / ( stringCount - 1.0 )

            #positionUpto = 0
            #stringPositions = list()
            #for i in range( stringCount ):
            #    stringPositions.append( positionUpto / TotalNutStringSpacing )
            #    print( "string %i nut position %.3f" % (i, positionUpto ))
            #    if( i != stringCount - 1 ):
            #        positionUpto += stringWidths[ i ] / 2
            #        positionUpto += spacingBetweenStrings
            #        positionUpto += stringWidths[ i + 1 ] / 2
            */

            // properly figure out the fretboard outlines, taking into account zero fret, etc etc etc...
            Line2 zeroFretLine = new Line2( fretLines[ 0 ] );
            Line2 nutLineLeft;
            if( !m_bZeroFret )
                nutLineLeft = zeroFretLine;
            else
                nutLineLeft = zeroFretLine.offset( m_dZeroFretNutOffset, Vec2.right );
            Line2 nutLineRight = nutLineLeft.offset( m_dNutWidth, Vec2.right );
            Line2 fbEndLine = new Line2( fretLines[ m_iFretCount ] );
            Line2 fret12Line = fretLines[ 12 ];

            Vec2 bassLine0 = new Vec2( 0, 0 );
            Vec2 bassLine12th = new Vec2( 0, 0 );
            zeroFretLine.intersectInfinite( new Line2( 0, FretboardWidthAtNut / 2, 100, FretboardWidthAtNut / 2 ), ref bassLine0 );
            fretLines[ 12 ].intersectInfinite( new Line2( 0, FretboardWidthAt12th / 2, 100, FretboardWidthAt12th / 2 ), ref bassLine12th );

            Line2 fbBassLine = new Line2( bassLine0, bassLine12th ); //new Line2( //stringTopEdges[ 0 ].offset( edgeOfFretboardSpacing, Vec2.up );
            Line2 fbTrebleLine = fbBassLine.mirror( new Line2( 0, 0, 1, 0 ) ); //stringBottomEdges[ m_iStringCount - 1 ].offset( edgeOfFretboardSpacing, Vec2.down );
            fbEndLine.v1.x -= 8;
            fbEndLine.v2.x -= 8;
            nutLineLeft.trimToInfinite( fbBassLine, Vec2.down );
            nutLineLeft.trimToInfinite( fbTrebleLine, Vec2.up );
            nutLineRight.trimToInfinite( fbBassLine, Vec2.down );
            nutLineRight.trimToInfinite( fbTrebleLine, Vec2.up );
            fbEndLine.trimToInfinite( fbBassLine, Vec2.down );
            fbEndLine.trimToInfinite( fbTrebleLine, Vec2.up );
            fbBassLine.trimToInfinite( fbEndLine, Vec2.right );
            fbBassLine.trimToInfinite( nutLineRight, Vec2.left );
            fbTrebleLine.trimToInfinite( fbEndLine, Vec2.right );
            fbTrebleLine.trimToInfinite( nutLineRight, Vec2.left );

            // draw fretboard
            d.DrawLine( "FretBoard", nutLineLeft );
            d.DrawLine( "FretBoard", nutLineRight );
            d.DrawLine( "FretBoard", fbEndLine );
            d.DrawLine( "FretBoard", fbBassLine );
            d.DrawLine( "FretBoard", fbEndLine );
            d.DrawLine( "FretBoard", fbTrebleLine );

            // draw frets
            for( int i = 0; i <= m_iFretCount; ++i )
            {
                if( i == 0 && !m_bZeroFret )
                    continue;

                Line2 fret = fretLines[ i ];
                fret.extendToInfinite( fbBassLine );
                fret.extendToInfinite( fbTrebleLine );
                d.DrawLine( "FretCentres", fret );

                // fretwire
                Line2 fretRight = fret.offset( m_dFretwireWidth / 2, Vec2.right );
                fretRight.trimToInfinite( fbBassLine, Vec2.down );
                fretRight.trimToInfinite( fbTrebleLine, Vec2.up );
                d.DrawLine( "Fretwire", fretRight );
                Line2 fretLeft = fret.offset( m_dFretwireWidth / 2, Vec2.left );
                fretLeft.trimToInfinite( fbBassLine, Vec2.down );
                fretLeft.trimToInfinite( fbTrebleLine, Vec2.up );
                d.DrawLine( "Fretwire", fretLeft );

                // put a little ellipse at the end to make it purty
                //d.DrawEllipseArc( "Fretwire", fretLeft.v2, fretRight.v2, 0.5, fretLeft.v2, fretRight.v2 );
            }

            // draw strings
            Line2[] stringLines = new Line2[ m_iStringCount ];
            Vec2[] saddleSpots = new Vec2[ m_iStringCount ];
            double dMaxSaddleX = -10000000.0f;
            double dMinSaddleX = 10000000.0f;

            for( int i = 0; i < m_iStringCount; ++i )
            {
                stringLines[ i ] = GetStringLine( i );
                stringLines[ i ].trimToInfinite( nutLineRight, Vec2.left );

                // calculate the estimated string intonation point
                saddleSpots[ i ] = stringLines[ i ].v1 + stringLines[ i ].direction * -stringCompensations[ i ];
                saddleSpots[ i ].y = stringLines[ i ].v1.y;
                dMaxSaddleX = Math.Max( dMaxSaddleX, saddleSpots[ i ].x );
                dMinSaddleX = Math.Min( dMinSaddleX, saddleSpots[ i ].x );

                // extend the string out to the saddle
                Line2 saddleLine = new Line2( saddleSpots[ i ].x, saddleSpots[ i ].y + 5.0f, saddleSpots[ i ].x, saddleSpots[ i ].y - 5.0f );
                stringLines[ i ].extendToInfinite( saddleLine );

                Line2 topEdge = stringLines[ i ].offset( stringWidths[ i ] / 2.0, Vec2.up );
                Line2 bottomEdge = stringLines[ i ].offset( stringWidths[ i ] / 2.0, Vec2.down );
                topEdge.trimToInfinite( nutLineRight, Vec2.left );
                bottomEdge.trimToInfinite( nutLineRight, Vec2.left );
                d.DrawLine( "StringCenterLines", stringLines[ i ] );
                d.DrawLine( "Strings", topEdge );
                d.DrawLine( "Strings", bottomEdge );

                //d.DrawLine( "Saddles", saddleLine );
            }

            // figure out where the saddle screw should go, based on its max adjustment
            //double dMaxSaddleAdjustment = 8.5;
            //double dAdjustmentRangeNeeded = dMaxSaddleX - dMinSaddleX;
            // DrawSaddleScrew will draw at the centre of the adjustment, so figure out an X that keeps everything close to the middle range

            // draw saddles & saddle screws
            for( int i = 0; i < m_iStringCount; ++i )
            {
                DrawSaddle( d, saddleSpots[ i ] );

                // draw min & max compensation points
                Vec2 minSaddleSpot = GetStringLine( i ).v1 + GetStringLine( i ).direction * -GetRequiredCompensation( i, m_dMinStringHeightAt12th );
                minSaddleSpot.y = saddleSpots[ i ].y;
                Vec2 maxSaddleSpot = GetStringLine( i ).v1 + GetStringLine( i ).direction * -GetRequiredCompensation( i, m_dMaxStringHeightAt12th );
                maxSaddleSpot.y = saddleSpots[ i ].y;

                //DrawSaddle( d, minSaddleSpot );
                //DrawSaddle( d, maxSaddleSpot );

                if( m_fBassScaleLength == m_fTrebleScaleLength )
                {
                    Vec2 screwSpot = new Vec2( saddleSpots[ i ].x, saddleSpots[ i ].y );
                    screwSpot.x = ( dMinSaddleX + dMaxSaddleX ) * 0.5;
                    DrawSaddleScrew( d, screwSpot );
                }
                else
                {
                    DrawSaddleScrew( d, saddleSpots[ i ] );
                }
            }

            d.AddLayer( "FretMarkers", Color.FromArgb( 255, 255, 255, 255 ) );
            //d.DrawCircle( "FretMarkers", new Vec2( 0, 0 ), 4 );
            DrawFretMarker( d, fretLines, 3 );
            DrawFretMarker( d, fretLines, 5 );
            DrawFretMarker( d, fretLines, 7 );
            DrawFretMarker( d, fretLines, 9 );
            DrawFretMarker( d, fretLines, 12, true );
            DrawFretMarker( d, fretLines, 15 );
            DrawFretMarker( d, fretLines, 17 );
            DrawFretMarker( d, fretLines, 19 );
            DrawFretMarker( d, fretLines, 21 );
            DrawFretMarker( d, fretLines, 24, true );

            // draw pickup positions
            DrawPickup( d, m_bridgePickup );
            DrawPickup( d, m_middlePickup );
            DrawPickup( d, m_neckPickup );

            /*			# draw some comparison pickup positions
            fStratNeckPos = 6.375 / 25.5
            fStratMiddlePos = 3.875 / 25.5
            fStratBridgePos = 1.625 / 25.5
            fStratBridgeBassPos = 1.815 / 25.5
            fStratBridgeTreblePos = 1.435 / 25.5
            fJBNeckPos = 6 / 34.0
            fJBBridgePos = 2.13 / 34.0
            fPRSNeckPos = 148 / 635.0
            fPRSBridgePos = 43 / 635.0

            fNewNeckPos1 = interpolate( 1/3.0, fJBNeckPos, fPRSNeckPos )
            fNewNeckPos2 = interpolate( 2/3.0, fJBNeckPos, fPRSNeckPos )

            writeScalePos( f, fStratNeckPos, "StratPickups", bridgeStringLine, nutStringLine )
            writeScalePos( f, fStratMiddlePos, "StratPickups", bridgeStringLine, nutStringLine )
            writeAngledScalePos( f, fStratBridgeBassPos, fStratBridgeTreblePos, "StratPickups", bridgeStringLine, nutStringLine )
            writeScalePos( f, fJBNeckPos, "JBPickups", bridgeStringLine, nutStringLine )
            writeScalePos( f, fJBBridgePos, "JBPickups", bridgeStringLine, nutStringLine )
            writeScalePos( f, fPRSNeckPos, "PRSPickups", bridgeStringLine, nutStringLine )
            writeScalePos( f, fPRSBridgePos, "PRSPickups", bridgeStringLine, nutStringLine )
            writeScalePos( f, fNewNeckPos1, "TristanPickups", bridgeStringLine, nutStringLine )
            writeScalePos( f, fNewNeckPos2, "TristanPickups", bridgeStringLine, nutStringLine )
            */
        }
Ejemplo n.º 30
0
        public void DrawEllipseArc( string strLayer, Vec2 majorAxisV1, Vec2 majorAxisV2, double minorAxisFactor, Vec2 vArcStart, Vec2 vArcEnd )
        {
            Vec2 vCentre = ( majorAxisV1 + majorAxisV2 )*0.5;
            Vec2 vMajorAxisEndpoint = majorAxisV2 - vCentre;

            m_out.Write( "  0\nELLIPSE\n  5\n" + m_iEntityNumber.ToString( "X" ) + "\n300\n1F\n100\nAcDbEntity\n  8\n" );
            m_out.Write( strLayer + "\n" );
            m_out.Write( "  6\nBYBLOCK\n100\nAcDbEllipse\n" );
            m_out.Write( " 10\n" + vCentre.x.ToString() + "\n 20\n" + vCentre.y.ToString() + "\n 30\n0.0\n" );
            m_out.Write( " 11\n" + vMajorAxisEndpoint.x.ToString() + "\n 21\n" + vMajorAxisEndpoint.y.ToString() + "\n 31\n0.0\n" );
            m_out.Write( "210\n0.0\n220\n0.0\n230\n1.0\n" );
            m_out.Write( " 40\n" + minorAxisFactor.ToString() + "\n" );

            double dArcStart = Math.PI;
            double dArcEnd = 2*Math.PI;
            m_out.Write( " 41\n" + dArcStart.ToString() + "\n 42\n" + dArcEnd.ToString() + "\n" );
            m_iEntityNumber += 4;
        }