loopspace / braids

TikZ package for drawing braids
6 stars 1 forks source link

Knots type cuts at crossings using the braids package #9

Open apoorvpotnis opened 7 months ago

apoorvpotnis commented 7 months ago

This is not an issue but a feature request.

Is it possible to have crossings of the type generated using the knots package for the braids package? By that I mean the following.

This is a crossing using the braids package.

Screenshot_20240117_101534

And this is a crossing using the knots package.

Screenshot_20240117_101502

The crossing using the knots package looks as if the upper strand has an invisible opaque tube surrounding it which covers the lower strand. The cuts to the lower strand are thus at an angle to the strand direction, while the cuts are always perpendicular to the lower strand in the braids package. I wanted to ask/request if there is a possibility of the knots type cuts in the braids package.

loopspace commented 7 months ago

The lines from the knots package look like that precisely because they do have an invisible (well, background colour) opaque tube surrounding them and it does cover the lower strand. Braids works differently; it knows exactly where the crossings are and so can actually split the path at that point. With standard line endings, though, then the ends are perpendicular to the path as you have seen.

It might be possible to muck about with the line endings to get something a bit more along the lines of the knot package, but to achieve the exact same effect as the knot package then you may as well use the knot package directly.

I suppose one possibility would be to use the braids package to define the paths and set the intersection points so that the knots package could use that directly and didn't have to compute them itself (since that's the computationally heavy part). So I'll leave this issue open to keep that in mind.

Do let me know your thoughts on any of the above.

apoorvpotnis commented 7 months ago

Yes, I actually used the knots package to draw braids in my thesis (the cut effect was too beautiful to let go😁).

I don't really understand the internals well enough to have an opinion on how to make the braids package provide intersection points to the knots package. But even if it is computationally expensive, I personally don't mind having a large delay at all. My understanding is that computers are getting faster and faster, and what takes a while now may not take much time in the future. The computationally heavy stuff can perhaps be skipped in the draft mode.