three-dxf icon indicating copy to clipboard operation
three-dxf copied to clipboard

Stange circles in dxf line work

Open katSchmid opened this issue 3 years ago • 6 comments

hi, Unfortunately i cannot share the file but we have some linework showing strange circles instead of buldges (left: ours, right three-dxf) image and qgis for comparison image

katSchmid avatar Aug 05 '21 06:08 katSchmid

Can you copy a small portion of that file containing one of those buldges into a new file and share that?

Serthys avatar Aug 05 '21 13:08 Serthys

i will try, has three-dxf an easy way to split out curves?

katSchmid avatar Aug 06 '21 05:08 katSchmid

I did a quick test with Splines and there are some strange things, I'm not sure if it's related to your problems. Sample file: spline test.zip This is how it should look like: image This is how it looks: image

The odd curves are not drawn correctly and where the spline has an odd number or points it joins the last one with 0,0,0.

Serthys avatar Aug 06 '21 10:08 Serthys

I dont have a real dxf editor, can i just dm you the file?

katSchmid avatar Aug 09 '21 07:08 katSchmid

@Serthys yeah, I didn't really know what I was doing when I implemented splines and I didn't have a good program to test things with at the time. It looks like you created a nice test for those. Would love a PR, even if it's just to add a failing test.

The issues here definitely look like issues with bulges. Also all the bulges seem to be originating from the end of a line so perhaps we aren't handling some edge condition for bulges? We'll definitely need at least a portion of the file to diagnose. Are you able to open the file and remove most of it but leave part of what is broken? Then you would just be posting a very tiny piece. Otherwise I suppose a DM will do.

bzuillsmith avatar Aug 10 '21 03:08 bzuillsmith

@Serthys I just pushed a partial fix for splines. It will now draw simple ones, but can't handle more that 4 control points. Three.js doesn't have an algorithm for more than that. I understand the fundamentals of splines much better now, but not well enough to write code that can handle any number of control points. From what I understand, it becomes a recursive computation as you add more points.

I plan to take a look at the bulge problem soon. Sorry, been getting reoriented with everything. It's been a while!

bzuillsmith avatar Sep 13 '21 08:09 bzuillsmith