Make "point intersection curves" tools define lengths

Hmm, doesn’t look good. TBH I was a little surprised it got merged so quickly. Given I just cut and paste a bunch of code it wouldn’t surprise me if some bits were missed. In particular, I’m not sure how that naming stuff works for arcs and it would seem the point numbers might be being reused.

2 Likes

Unlike splines (curves) - which use the naming scheme of Spl_ [1st point] _ [2nd point] - arcs have no end points. They are described by Arc_ [center point]_ [unique num]. But there’s no issue in the names that I’m seeing… what I’m more interested in is why in some cases only the full arc length and one segment length(the 1st one?) show in the Edit Formula dialog, while all 3 lengths show in the Table of Variables?

What I’m even more baffled at - and this is also an existing problem using the vtoolpointofintersectionarcs tool… if you have an arc of 360 degs (a circle) , and intersect it with another curve or axis there is still only 1 arc segment. So why does the program show 3 segments? And how is it coming up with the 3 segment lengths? In the example below there is an arc of 360 deg intersecting with a curve at A3…

2 Likes

That I think I understand. What it does is first calculate the intersection point of the two curves, and then calls VArc::CutArc() on the circle. As the comment states this will always return two arcs. The circle goes from 0 to 360 so there is a start and end, even if you don’t see it. And the Arcs in the variables list refer to those. Not very useful obviously.

As to how they can appear in one list and not the other. Maybe it’s a time-travel thing? It’s not showing them because it thinks they’re not available at this point?

2 Likes

Got that… but if you look at the example I gave one segment is nearly 2 inches from 0 or 360… you would be able to see that. Where is THAT point coming from?

Also when I say there are no end points I’m referring to the tool and point names… in this tool the end points of the arc are calculated - there is no stored point names that can be used in formulas or referenced by other tools. This tool is not an arc defined by 2 points and a radius. The fact it has no end point names, you can’t construct segment names like you can with splines.

I thought of that… I had the Variables Table open at the same time as the Edit Formula dialog. They should be showing the same thing… in fact I think both dialogs call the same function to get the data from VContainer. On the bright side there does not seem to be this discrepancy with splines.

2 Likes

OK there’s now a separate discussion thread for the Intersect Arcs tool,

1 Like

So I should probably revert this commit (Edit: Didn’t revert the commit, but I squashed all the commits following it), and we’ll look at this problem. This tool has extensive logic flaws.

@rode_kater - would you have another go at this? Maybe start with the refactoring, don’t add any functionality yet. Get that section to be reusable, you might see more about where the logic is failing. That sound ok to you?

2 Likes

Let me see if I understand this correctly:

  • Arc_A_3 = circumference of circle around A, starting at 0 degrees, going to 360 degrees (=Arc_A_8 + Arc_A_9)
  • Arc_A_8 = distance from 0 degrees counterclockwise on the circle around A to A3
  • Arc_A_9 = distance from 360 degrees clockwise on the circle around A to A3

The splines give explicit begin/end points and they look fine. So the example looks fine to me, what am I missing? The points a 0 and 360 degrees on the arc are not named (though the both happen to fall on the line A-A1) but they do exist as far as the geometry is concerned. If you change your Arc_A_3 to start at 10 degrees it would be obvious what’s going on I think.

2 Likes

Hoi @slspencer,

I can refactor the common code, that’s no problem. As for the issues, I’m not totally clear yet where to look.

In particular, the discrepancy between the variables table and the “edit formula” dialog. I know the “edit formula” dialog (which I think is called dialogeditwrongformula) filters the list based on where you are to show only variables from tools before this one, and hide those from later pattern pieces. But I can’t for the life of me work out in the code where this happens. There is a function called “Filter” which looks hopeful, but it’s too simple.

1 Like

@douglas & @rode_kater - You’ll need to do a “git pull --force” next time you update your develop branch or it will fail because I squashed the commits & reverts from the last 3 days.

1 Like