Search found 103 matches

by Rishavs
Thu Jul 28, 2016 3:37 am
Forum: General
Topic: Dealing with floats
Replies: 12
Views: 5628

Re: Dealing with floats

Thanks guys. So far the fuzzy/epsilon/delta method is working. @ivan, yeah the problem is with using == operators with floats. I spent over a week doing my incredibly comprehensive line intersection algo, so i'd stick with it a bit longer. Here is it in all its glory. Read and be awed. Or laugh at m...
by Rishavs
Wed Jul 27, 2016 7:40 pm
Forum: General
Topic: Dealing with floats
Replies: 12
Views: 5628

Re: Dealing with floats

i am currently checking intersection of thousands of lines which in turn require slope comparisons. Out of the thousands of slopes, few always come up wrong no matter what i do. Your delta method looks very simple and nice. Gotta try ! Got any more tricks for floats? I am not a good programmer and l...
by Rishavs
Wed Jul 27, 2016 6:37 pm
Forum: General
Topic: Dealing with floats
Replies: 12
Views: 5628

Dealing with floats

Heyo So, I spent the last week debugging my binary partitioning algorithm using print and console commands. I combed through my code hundreds of times but couldn't identify the issues. Till today. the issue was with floats. See, my code is full of variable comparisions there were comparisons like A ...
by Rishavs
Tue Jul 26, 2016 6:20 am
Forum: General
Topic: What's everyone working on? (tigsource inspired)
Replies: 1791
Views: 1505301

Re: What's everyone working on? (tigsource inspired)

Working on something more basic. Voronoi plots without using Fortune's algorithm. :3
If it works properly, i'd like to package it as a library and share with all.
by Rishavs
Thu Jul 14, 2016 3:46 pm
Forum: General
Topic: Finding neighbours on an arbitrary polygon grid
Replies: 6
Views: 7445

Re: Finding neighbours on an arbitrary polygon grid

oh dear. that sucks. :( I am working of a neighbour algorithm right now. was hoping there was some way of avoiding it. Its getting messy with every line i write. :( @vrld. thanks. i learn new things everytime on this forum. it will help me optimize my intersection a lot. I can simply remove all non ...
by Rishavs
Thu Jul 14, 2016 10:27 am
Forum: General
Topic: Finding neighbours on an arbitrary polygon grid
Replies: 6
Views: 7445

Finding neighbours on an arbitrary polygon grid

Hi I have a grid composed of convex polygons with variable sides. SOmething similar to voronoi plots. For any face/polygon i want to find all its neighbouring polygons (which share a side). For regular grids made of rectangles, triangles, heaxgons wtc, we can simply employ an indexing system which g...
by Rishavs
Tue Jun 28, 2016 4:34 pm
Forum: Support and Development
Topic: finding where does a line touches a polygon
Replies: 5
Views: 3435

Re: finding where does a line touches a polygon

Thanks everyone.
My current implementation does works but I was wondering if using the Shape object will be much faster.
by Rishavs
Tue Jun 28, 2016 11:22 am
Forum: Support and Development
Topic: finding where does a line touches a polygon
Replies: 5
Views: 3435

finding where does a line touches a polygon

Hi i have a polygon made up of x1, y1, x2, y2, ... xn, yn vertices. there is a line y = mx + a which goes through the polygon. How can i find the points where the line touches the polygon? I was planning on using the physics module and the Shape:testSegment function. But it looks like its been depre...
by Rishavs
Tue May 17, 2016 7:37 am
Forum: General
Topic: Finding unique edges in a list of edges
Replies: 4
Views: 2122

Re: Finding unique edges in a list of edges

thanks everyone. lots of good ideas here. Gonna try them now.
by Rishavs
Thu May 12, 2016 1:06 pm
Forum: General
Topic: Finding unique edges in a list of edges
Replies: 4
Views: 2122

Finding unique edges in a list of edges

Hi I am creating a procedural graph made up of points and lines connecting the said points. I have created a list of edges/lines as; { {{a1, b1}, {x1, y1} }, {{a2, b2}, {x2, y2} }, ... ... {{an, bn}, {xn, yn} } } Now I want to find all the unique edges. Ie. remove all edges that have same starting p...