Updating the Point of Intersection tool

Hi folks.

As I work on some putting some patterns in Seamly2D for the current job I’m working, I was reminded of one tool I wanted to update - the Point of Intersection tool. I use this a lot to locate a point to create lines that I can use in the control point of curves… such as armholes. It’s a tedious process to create the point, then add two lines so you then have the line lengths towork with, as well as the visual. Well… I updated the tool so it automatically adds the lines.

tool1

As you can see the tool now displays the 2 lines - without having to use the line tool twice - and you now can change the color of the line, and thus the point name color. Also you may note you also have control of the line weight - more on that. Here’s the updated tool dialog:

tooldialog2png

A couple notes here. Note the change of tool name - it will now be Intersect XY, which will go along with Intersect Lines, Intersect Arcs, Intersect Circles. Also note that - yes - you can have a line width of Zero. Qt simply treats a width of zero as being a cosmetic pen, or a 1 pixel wide pen… which you might have figured out that zero at any scale is always zero. In other words it’s always 1 pixel wide regardless of the zoom factor.

So… you now would have access to the line lengths:

variables

which are also displayed in the tooltip:

tooltip

Also the Property Editor is semi updated… it lacks the line weight combo box, which will take a deeper dive to update that, as the line weight is a custom combo box of mine that needs to be implemented across all the tools.

propertyeditor

In checking out the updates - in particular is it de-referencing properly? - I noticed an undesirable behavior and went uh oh. That is, if you create a new Intersect XY point, and then use one of the line lengths in a formula of another tool, then delete the Intersect XY tool you get the proverbially broken fx dialog:

brokenfx

So what does this mean? I went over an over the code, and then found out - THIS HAPPENS WITH ALL THE TOOLS!. Only the points or curves you use in another tools formula are referenced / dereferenced. In other words using a tool’s length or angle in an FX does not disable the Delete for that tool. This needs further investigation, and while not exactly a bug (as the exception is caught and handled), it’s no doubt lead to many a broken patterns. I would say if this pops up, best to Undo… save a backup, and then proceed from there. if you just cancel you have no doubt left the pattern broken, and it won’t open. You can fix the formula, but that also in some way has probably left the pattern broken in a sense. The best thing to do is backtrack and dereference the offending variable, until you can safely delete what you were trying to delete.

Ok… so what about the line weight? Well, since I needed to avoid the above issue of opening a new pattern with the updated tool in an previous version of the app I created a new xml schema 0.6.4 file - which other than the name is the same of 0.6.3. The updated tool does not add anything new to the xml so I figured the app would just go through the normal conversion process from 0.6.3 to 0.6.4 - which really doesn’t change anything. Nope. There’s a feature of the conversion process that if nothing new / different from the new schema is used in a pattern, when trying to open it in a previous ver, it’s happy to do so, IE. When trying to open a test of a 0.6.4 pattern in a 0.6.3 ver of the app, it opens the pattern as “down graded” as if it were an 0.6.3 pattern, and for all intents and purposes it is an 0.6.3 pattern. So it throws the broken fx dialog. :frowning: That’s where the line weight comes in. I NEEDED to actually make a change in the schema to force the app to validate the pattern file as 0.6.4 - which will fail with an 0.6.3 build of the app. So I added the line weight - which I’ve wanted to do anyway. So now, since some of the basic code for the lineweight is in place, as I (re)update the rest of the tool dialogs I can add the line weight to them. Which to be honest I’m finding it easier to see wider lines on the screen without needing my glasses on. :slight_smile:

4 Likes

Though there are times when someone will want to set the line to [blank] I can think of many more times when I would have been glad of this feature.

I hope that in the release version those lines are referenced as Line_A_A2 & Line_A1_A2 in the tooltip, instead of Line 1(2) Length

2 Likes

You can always just set the linetype to none OR add the tool to a group and hide the group, albeit that would also hide the point name as well. The real benefit though is not so much the fact that the lines are persistent, but rather you save 2 steps of having to create two lines for the lengths.

Yeah, I noticed that. line1 and line2 are the variable names for the line items. Don’t know why I hard coded the text like that as I specifically added getters to retrieve the actual line names. Doh.

2 Likes

Updated the tooltip… improved the html table layout to better align the text. Added the tool name as well. Will improve the tooltips as I update the tool dialogs.

newtooltip

As an aside - Some of the tooltips are formatted stangely - like the Point Along Line… instead of Line_A_A2 it uses A->A2, for ex:

paltooltip

I would prefer to make them consistent with the rest of the tooltips, the Fx, and Variables table.

1 Like

Thank you very much, @Douglas. This is an item that is long overdue, that I have been wishing for, for a very long time. You’re a star.

I know… we’ve discussed this before. I made sure to check what happens if you load an older pattern that uses 2 lines… it loads fine, and you will only see 1 unique line name as duplicates are not saved in the data container. Plus you can then safely delete the line tools as the Intersect XY tool will create the line names that you may used in formulas so you won’t crash with the Broken Fx. :slight_smile:

BTW, I aready have the wheels turning on a twist on this tool for a new tool. Instead of placing the new point at the intersection of 2 existing points, the intersection would be at X and Y length from an origin point. Or basically a rectangle. Picture if you click on an orgin point, then rubber band a rectangle to some other point … like say a point on a background image… release the mouse, and now you’ve got 3 new points with the width and height - which can then be modified or “graded” based on a set of grading rules. :slight_smile: Basically it would be analogous to using a (large) digitizing tablet and cross hair mouse to enter (existing) patterns. Just need a fairly accurate picture of pattern pieces with minimal parallax error.

3 Likes

So we’d be able to make a rectangle in one easy step, instead of a minimum of two —mathy to very mathy— steps, or, more likely, three easy steps, right?

2 Likes

Most times (I cannot remember having destroyed a pattern through this) the fix formula in the “broken formula” dialog works without errors.

2 Likes

Wow! Sounds amazing! Can’t wait for the update :star_struck:

Has anyone found the need for this tool at an angle? I often need one.

2 Likes

That’s my thinking. 1 easy step… 2 if you want to go in the tool dialog and tweak the width & height.

2 Likes

Do you mean to add rotation to a rectangle tool or to the Intersect XY?

Just a thought…

  1. Select first point that activates an Arrowed Axis (Ray)
  2. Set angle of Axis with mouse* - can later be set in dialog.
  3. Select second point, which draws second Arrowed Axis (Ray) with mouse* - which also can be set in dialog
  4. New point is intersection of the 2 Axes, length of lines available for use in Fx.
  • Angle could also be constrained with Ctrl to intersect at 15 degree intervals.

New tool name “Intersect Axes”. :slight_smile: Yes, you could accomplish the same thing using a Point at Distance and Angle, and Intersect Axis & Line… but it’s more work, and you have that extra point and line segment dangling out there.

The Intersect XY tool is really a special case of this, with the Axis rotation being locked at 90 and 180.

1 Like

LOL, it’s just me being really lazy. :rofl:

I have this shirt pattern that I’m making and the sleeve cap is drafted according to the armhole, and this is where that Point of Intersection tool comes in so handy in making perfect curves that resize beautifully… but it doesn’t work in this case:

image

It is still possible to do something with the other, existing, tools. :grinning:

But it can be a thought for the future…

2 Likes

I just call it being efficient. :slight_smile:

Ah. The example definitely helps to visualize. This is certainly doable. It’s just a matter of how to have the interaction work, and whether the intersection angle is variable, or set at 90 deg. Locking the intersection at 90 it’s bit harder to implement the visualization, but eliminates the issue of what to do if the 2 axes do not intersect all.

2 Likes

Actually, there is a tool that does this very easily… Here’s what I did:

I repeated the the same tool to create A42 on the new line A37-A31_a1_M from J at the angle G-H, and only needed a line between A31_a1_M-A42 to complete the scaffolding for the sleeve cap curve.

1 Like

I can think of a number of ways to do this… but most are all multistep and/or require adding a line or 2 to get the length and visual feedback.

1 Like

Made a few updates…

Changed the element tag to “intersectXY”, and to stop the Properties Editor from complaining about a missing attribute, set defauts for the line tyoe, weight, and color attributes.

Also a minor issue presented itself. If you load a converted pattern, and you previously used two lines, and if either of the lines is named with the points reversed from what the IntersectXY tool will create AND if you referenced one of the said lines AND if you delete it… it will throw the Broken Fx dialog. No problem… just fix the reference with the correct line name as the tool created.

2 Likes

Finally pushed this feature, and the PR passed the test. Just waiting to get merged.

1 Like

Feature merged.

1 Like