Thanks for pointing out the distinction in use of table and object. That helps.
In python I would probably do:
spline = {
't': [],
'xy': [],
'v': [],
'a': [],
'length': []
}
Run
and then instead of seqfd1.add(fd1) in the final loop
> [https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html](https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html)
Haha, you're going to fast for me :) my programming skills are 'minimal' and
mostly POV-Ray SDL so I try to go step by step. I'll study!
Thanks.
Ah. I'll have a go at it. Thanks.
Actually solved it in a different way, created an enum to pass meaningful
information to the next proc.
type
Intersection = enum
intersect,
parallel,
zerolength,
notsegment
proc lintersect(p1, .): (Intersection, Vec2) =
...
In the end I kept it simple:
[https://gist.github.com/ingoogni/ed87bc92c5d2a2da5038dd368a238ac5](https://gist.github.com/ingoogni/ed87bc92c5d2a2da5038dd368a238ac5)
Thanks.
some of my procs can have no result so I'd like them to return false or a
value. For now I have
proc lintersect(p1, p2, p3, p4: Vec2, segments=false): (bool, Vec2) =
.
if parallel
return (false, vec2(0,0))
.
.
return (true, vec2(x,y))
Run
Being new at this I ran into several problems. First some code:
import vmath
type
Seg = array[4, Vec2]
Segs = array[4, Seg]
Spline = tuple[t: seq[float32], xy: seq[Vec2], v: seq[Vec2], a:
seq[Vec2], lengt: seq[float32]]
proc bezier(segment: Seg,