Grasshopper

algorithmic modeling for Rhino

Hi,

Have anybody experience with function getNextDiscontinuity? I want to found point of Discontinuity on curve.

Any idea?

Best, Joach

Views: 2387

Replies to This Discussion

Joach, attached is a VB component that checks for discontinuity along the curve within a domain t0 - t1. Below is a description of each variable.

--------------
c - [in] type of continity to test for. If ON::C1_continuous
t0 - [in] search begins at t0
t1 - [in] (t0 < t1) search ends at t1
t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity.
hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
dtype - [out] if not NULL, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous.
cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::G1_continuous or ON::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported.
curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported.
Attachments:
Thank you Dirk

I found at evening a way how to use this function too, but i have still two question about it.
First, what is represent by ON::C1_continuous (i use instaed it only int = 2). Is it curvature of curve or what? And second question, exist some way, how to found a count of point of discontunity on some curve? I tryed this, but it isnt genarally. It still depent on numbre of interavls(1000).

Function discontPt(ByVal crv As onCurve) As list (Of on3dpoint)
crv.SetDomain(0, 1)

Dim T,oldT As Double
Dim pts As New List(Of On3dPoint)

oldT = -1
For i = 0 To 1000
crv.GetNextDiscontinuity(2, 1 / 1000 * (i + 1), 1 / 1000 * i, t)
If oldT <> T Then
pts.Add(crv.PointAt(t))
End If
oldT = T
Next

Return pts
End Function

Thx, Jachym

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service