Coder Social home page Coder Social logo

Comments (3)

samestep avatar samestep commented on June 16, 2024

I'm unable to repro this; could you clarify exactly what code you're using? Note carefully that the sample solution code for Exercise 2 refers to earlier code from the tutorial itself:

/**************YOUR CODE - START********************/
forall Vector u; VectorSpace U
where In(u,U) {
 /* ...concatenated, this is the same as Tutorial Part 1 */
}

from penrose.

Doublonmousse avatar Doublonmousse commented on June 16, 2024

Ok, I put my code on a repo

https://github.com/Doublonmousse/penrose-debug-tutorial-2

Going over it again, it seems that the issue is not what I thought it was initially : I can get it to work if the scalar value is not given a random value but is fixed at the start.

However, with all constraints enabled and the scalar value given a random value, the layout optimisation algorithm seems to fail (or gives potentially incorrect results just like the screenshot I put before for reference).

I can get it to work with the first two constraints

    -- constraints : given enough constraints, impossible to use ? for the scalar value (?)
    ensure contains(U.Background,u.shape)
    ensure contains(U.Background,u.text) 

but not with more (if the scalar value is set randomly).

There is no problem on the scalar/vector multiplication side, I thought that this was the issue as everything was still working if I added something to the vector instead of multiplying.
And I get the same results (without errors if the scalar value is set) regardless of the method used for the scalar/vector multiplication.

from penrose.

samestep avatar samestep commented on June 16, 2024

Thanks for the update! You're right, even when I use the example solution code, sometimes the blue vector extends outside of the box and the labels end up in the wrong place; but sometimes it lays out fine. Gonna ask on Discord about this to see if anyone has any ideas.

from penrose.

Related Issues (20)

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.