DOSLib icon indicating copy to clipboard operation
DOSLib copied to clipboard

dos_isinsidecurve - wrong results in some cases?

Open Pierre-de-la-Verre opened this issue 5 years ago • 3 comments

DosLib_-_dosisinsidecurve.zip

Hi

I found that in some cases - depending on the coordinates of the point and on the form of the curve - the result of this functions gives NIL (out), although it should be TRUE (inside).

Find attached the

  • link for a screencast as ZIP
  • the relating drawing
  • a simple lisp used for simple usage of the function.

I'm not sure on which side of the keyboard the problem resides ..

Have a good time! dos_isinsidecurve.zip

Pierre-de-la-Verre avatar Nov 10 '20 16:11 Pierre-de-la-Verre

Hi @Pierre-de-la-Verre,

If you move your curves close to the world origin, does the function work as expected?

-- D

dalefugier avatar Nov 10 '20 22:11 dalefugier

Hi @dalefugier

I made more tests: a) With Autocad with high coordinates, like above: there are missing some lines in different curves b) With Autocad with low coordinates (1000, 8000): there is no result (nothing "in") in one curve c) With Bricscad: same as b)

a) and b) are documented in a (long) screencast; from start to approx. 12 min shows chapter a), the following chapter b) see attachment

c) is documented here: see attachment dos_isinsidecurve_Bricscad_20,_low_coordinates.mp4.zip

I attach the DWG with low coordinates

dos_isinsidecurev_low_coordinates.zip

Pierre-de-la-Verre avatar Nov 11 '20 09:11 Pierre-de-la-Verre

Hi,

Another issue: The algorithm uses, what I will call, the 'count intersections with a single ray' method. This method fails when the point lies on an extended edge of the boundary.

See here: http://ww3.cad.de/foren/ubb/Forum145/HTML/000602.shtml#000008 And see here for a potential solution: https://www.theswamp.org/index.php?topic=48399.msg546187#msg546187

In the attached dwg (zipped) the origin is reported as no lying inside the polyline.

single_ray_test.zip

Roy-043 avatar Nov 11 '20 11:11 Roy-043