Coder Social home page Coder Social logo

Comments (6)

hoodmane avatar hoodmane commented on June 2, 2024

There is a frustrating compromise here: I am not sure how to calculate the right start location of the bent line, but people sometimes use dots with no fill, and then it doesn't look correct. Maybe there could be a setting to choose which way, since going to the center is faster and better as long as the shape is filled, but with no fill it's better to use the setback.

I implemented a real solution to the problem of calculating Bezier setbacks at one point in Rust, but it is pretty tricky -- I do a first order approximation of Bezier arclength and then set back the start point by that much, then calculate the error and estimate again. This generally produces a point right on the boundary of the shape. I think on a diagram with lots of bent lines, this would take an unacceptably long time in latex.

As you pointed out, all of the math is much easier if you use circular paths rather than Bezier curves.

from latex.

hoodmane avatar hoodmane commented on June 2, 2024

You can use:

\begin{sseqpage}
    \class(0, 0)
    \class(1, 1)
    \structline[bend left = 50, source anchor=center, target anchor=center]
\end{sseqpage}

for this.

But it doesn't seem like source anchor and target anchor work as a style option: edges={source anchor=center, target anchor=center} doesn't seem to work.

from latex.

hoodmane avatar hoodmane commented on June 2, 2024

Okay, but the following also works fine:

\begin{sseqpage}[structlines={source anchor=center, target anchor=center}]
    \class(0, 0)
    \class(1, 1)
    \structline[bend left = 50]
\end{sseqpage}

from latex.

dalcde avatar dalcde commented on June 2, 2024

from latex.

hoodmane avatar hoodmane commented on June 2, 2024

Fair enough, I will look into it and see what I can do.

from latex.

hoodmane avatar hoodmane commented on June 2, 2024

I guess this was simpler than I expected.

from latex.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.