Hi,
I was going through the forum, trying to find how GH classifies curves. I couldn’t find anything but from the best I could guess there are these 6 types:
(I’m not talking about the creation method, just the curve’s nature)
1. Line-like: a straight line defined by two control points 2. Arc-like: part of a circle 3. Circular: a circle 4. Elliptical: both a full and a partial ellipse are recognized as “elliptical curve” 5. Planar: a non-straight curve that all of its control points are planar 6. (just) Curve: a curve that its control points are not planar.
(and of course the ‘polyline’ which could be a combination of all of the above…)
Are these all the ways GH can classify a curve?
Also: apart from circle/ellipse, does GH ‘recognize’ Hyperbolae/ Parabolae/ Helix(ae) etc?
If (data Is Nothing) Then Return String.Format("Null {0}", name)
If (Not data.IsValid()) Then Return String.Format("Invalid {0}", name)
If (data.IsArc()) Then
If (data.IsClosed()) Then Return String.Format("{0}Circular {1}", prefix, name)
Return String.Format("{0}Arc-like {1}", prefix, name)
End If
If (data.IsEllipse()) Then
Return String.Format("{0}Elliptical {1}", prefix, name)
End If
If (data.IsLinear()) Then
Dim pts As Polyline = Nothing
If (data.TryGetPolyline(pts)) Then
If (pts.Count = 2) Then
Return String.Format("{0}Line-like {1}", prefix, name)
End If
End If
Return String.Format("{0}Linear {1}", prefix, name)
End If
If (data.IsPolyline) Then Return String.Format("{0}Polyline {1}", prefix, name)
Dim closed As String = String.Empty
Dim planar As String = String.Empty
If (data.IsClosed()) Then closed = "Closed "
If (data.IsPeriodic()) Then closed = "Periodic "
If (data.IsPlanar(0.001)) Then planar = "Planar "
Return String.Format("{0}{1}{2}{3}", prefix, closed, planar, name)
name can be either "Curve" or "Edge", and the prefix is either an empty string or "Referenced".
This is an example of using David’s list of “geo labels” (see panel on left) to parse “raw text” output. It can be written many different ways in standard GH, depending on your needs. Such as returning numbers instead of text labels. C# won’t necessarily be easier or better.
To answer to your PM:
I am not boasting or anything: I am a pationate lover of parametric design and I want to become good at it and I also feel very humbled by the gigantic knowledege of people around this forum.
Don’t misunderstand enthusiasm for arrogance… in the end it’s not about knowing, its about learning. (and of course: having fun in the process!!!)
Not sure why you want to reply publicly to a PM but if that’s what you prefer, let’s put it in context.
This is the full text of my PM reply:
To answer your question privately, your statement that “It might be my last big definition I do traditionally” sounds absurd and I frankly don’t believe you. It sounds like boasting about something you haven’t even started yet. Too much talk, not much GH code yet, certainly not enough to approach the limits of what it can do.
his is an example of using David’s list of “geo labels” (see panel on left) to parse “raw text” output. It can be written many different ways in standard GH, depending on your needs. Such as returning numbers instead of text labels. C# won’t necessarily be easier or better.
is there any difference between arc and arc-like curves?
if yes, what is the difference?
if not, so why (for example) in the grasshopper help it written like this (image below↓)
I guess the next comparison should be line and line-like curve!