Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [V8i VBA] Finding Tangent Vector of point on an element

$
0
0

Hello Jon,

I wrote the following test snippet to verify the correction of method EvaluatePointTangent. FYI

Sub PlacePointAndTangent(pt As Point3d, tangent As Point3d)
   Dim oLine As LineElement
   Set oLine = CreateLineElement2(Nothing, pt, pt)
   oLine.LineWeight = 10
   ActiveModelReference.AddElement oLine
   
   Dim vec As Vector3d
   Dim secPt As Point3d
   vec = Vector3dFromPoint3d(tangent)
   secPt = Point3dAddPoint3dVector3d(pt, vec)
   Set oLine = CreateLineElement2(Nothing, pt, secPt)
   oLine.LineWeight = 0
   ActiveModelReference.AddElement oLine
End Sub

Sub TestEvaluatePointTangent()
    Dim oBElem As BsplineCurveElement
    Dim oBCurve As BsplineCurve
    Dim pt As Point3d, tangent As Point3d
    Set oBElem = ActiveModelReference.GetElementByID(DLongFromLong(510))
    Set oBCurve = oBElem.ExtractBsplineCurve
    For u = 0 To 1 Step 0.1
       pt = oBCurve.EvaluatePointTangent(tangent, u)
       PlacePointAndTangent pt, tangent
    Next
End Sub

ElementID 510 is a BsplineCurve id.

Test DGN is also attached.

(Please visit the site to view this file)


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>