Showing results for 
Search instead for 
Do you mean 
Reply

Geometry library

Hi,

 

Has anyone developed a .net library that does basic geometric functions such as :

1. Adding a point and a vector.

2. Creating a Matrix.

3. Translating a point.

4. Rotating a point about an axis.

etc

 

Thanks,

-Thilak Rao

2 REPLIES

Re: Geometry library

We actually implemented our own point/vector math in the Custom.vb.

Re: Geometry library

    '***************************************************************************************************************
    '***************************************************************************************************************
    ' POINT AND VECTOR CLASS NEEDED TO DO VECTOR AND POINT STUFF.
    '
    ' Class GeoPoint       create a new point in a RS Formula:  New GeoPoint
    '     Property: X       Access in a RS Formula:  p.x
    '     Property: Y                                p.y
    '     Property: Z                                p.z
    ' Class GeoVector      create a new vector in a RS Formula:  New GeoVector
    '     Property: X       Access in a RS Formula:  v.x
    '     Property: Y                                v.y
    '     Property: Z                                v.z
    ' 
    '***************************************************************************************************************
    '***************************************************************************************************************
    ' VECTOR FUNCTIONS
    '
    ' AlignmentCosine(ByRef V1 As geoVector, ByRef V2 As geoVector) As Double
    ' AngleBetweenVectors(ByRef V1 As geoVector, ByRef V2 As geoVector) As Double
    ' AreVectorsInSameDirection(ByRef V1 As geoVector, ByRef V2 As geoVector) As Boolean
    ' AreVectorsParallel(ByRef V1 As geoVector, ByRef V2 As geoVector) As Boolean
    ' AreVectorsPerpendicular(ByRef V1 As geoVector, ByRef V2 As geoVector) As Boolean
    ' CrossProduct(ByRef P1 As geoVector, ByRef P2 As geoVector) As geoVector
    ' DotProduct(ByRef P1 As geoVector, ByRef P2 As geoVector) As Double
    ' ReverseVector(ByRef Vector As geoVector) As geoVector
    ' ScalarDotVector(ByVal Scalar As Integer, ByRef V1 As geoVector) As geoVector
    ' UnitizeVector(ByRef V As geoVector) As geoVector
    ' VectorNormal(ByRef V As geoVector) As Double
    ' VectorToString(ByRef V1 As geoVector, ByVal tolerance As Double = 0.0001, Optional ByVal delimiter As String = ",") As String
    ' StringToVector(ByRef S1 as String, Optional ByVal delimiter As String = ",") As geoVector
    '
    '***************************************************************************************************************
    '***************************************************************************************************************
    ' POINT FUNCTIONS
    '
    ' DistanceBetweenPoints(ByRef Point1 As geoPoint, ByRef Point2 As geoPoint) As Double
    ' DistanceFromPointToPlane(ByRef Point As geoPoint, ByRef PPoint As geoPoint, ByRef Normal As geoVector) As Double
    ' IsPointBetweenPlanes(ByRef Point As geoPoint, ByRef StartP As geoPoint, ByRef EndP As geoPoint, Optional ByVal tolerance As Double = 0.00005) As Boolean
    ' IsPointBetweenPoints(ByRef Point As geoPoint, ByRef StartP As geoPoint, ByRef EndP As geoPoint, Optional ByVal tolerance As Double = 0.00005) As Boolean
    ' IsPointOnArc(ByRef Point As geoPoint, ByRef StartP As geoPoint, ByRef EndP As geoPoint, ByRef CntrP As geoPoint, Optional ByVal tolerance As Double = 0.00005) As Boolean
    ' MidpointOfPoints(ByRef Point1 As geoPoint, ByRef Point2 As geoPoint) As GeoPoint
    ' MovePointAlongVector(ByRef Point As geoPoint, ByRef Vector As geoVector, ByRef Distance As Double) As geoPoint
    ' SubtractPoints(ByRef P1 As geoPoint, ByRef P2 As geoPoint) As geoVector
    ' AddPoints(ByRef P1 As geoPoint, ByRef P2 As geoPoint) As geoPoint
    ' VectorIntersectionPointOnPlane(ByRef VPoint As geoPoint, ByRef Vector As geoVector, ByRef PPoint As geoPoint, ByRef Normal As geoVector) As geoPoint
    ' PointToString(ByRef P1 As geoPoint, ByVal tolerance As Double = 0.0001, Optional ByVal delimiter As String = ",") As String
    ' StringToPoint(ByRef S1 as String, Optional ByVal delimiter As String = ",") As geoPoint
    ' ReverseStringOfPoints(ByRef S1 as String, Optional ByVal delimiter As String = "|") As String
    ' TransformPointsToAngle(ByVal S1 As String, ByVal Angle As Double, Optional ByVal delimiter As String = "|") As String
    ' TransformPointsToPosition(ByVal S1 As String, ByVal Offset As GeoPoint, Optional ByVal delimiter As String = "|") As String
    '  
    '***************************************************************************************************************
    '***************************************************************************************************************
    ' ROUTING FUNCTIONS
    '
    ' ArcLength(ByRef tan1 As geoPoint, ByRef tan2 As geoPoint, ByRef cntr As geoPoint) As Double
    ' DistanceFromRoutingStart(ByRef RoutingVerts As String, ByRef Point As geoPoint, Optional ByVal tolerance As Double = 0.00005) As Double
    ' GenerateRoutingPoints(ByRef CircVerts As String, ByRef CircBendRad As Double) As String
    ' GenerateRoutingPoints(ByRef nodes As Collection) As String
    ' GenerateRoutingPoints(ByRef circpnts As Collection, ByRef bendrads As collection) As String
    ' BendAngleAndRadiusList(ByRef RoutingVerts As String) As String
    '