Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Nicolas Silva
    @nical
    home -> some
    Andreas Monitzer
    @anlumo
    What I'm going to need in the future is a path walker with pseudo-random step distances, but I guess I can do that in my own code by implementing the Pattern trait based on RepeatedPattern.
    matrixbot
    @matrixbot
    nical Yeah you should implement your own patterns for things like that
    Mike Welsh
    @Herschel
    @nical Thank you!
    Nicolas Silva
    @nical
    @anlumo lyon 0.13.4's path walker has a hook that is called at the beginning of each sub path: nical/lyon#480 you can implement Pattern::begin
    Andreas Monitzer
    @anlumo
    Thank you!
    Charles Lew
    @crlf0710
    @nical Could you point to me to some resources on algorithms or crates implementing path boolean operations and even-odd <=> non-zero winding fills conversions?
    matrixbot
    @matrixbot
    nical Lyon's work in progress tessellator rewrite supports both even-odd and non-zero fill rules: https://github.com/nical/lyon/pull/334/files
    There's a new crate in the works by eddy bruel called bender which has a "clipper" that does both clipping and applying the fill rule (although the generated data structure is different from the input one) https://gitlab.com/ejpbruel/bender/blob/WIP/clipper/src/lib.rs it's not quite boolean operations but if you need clipping it is probably a good reference.
    I'm on my phone and I don't have my links to interesting algorithms handy but I'll try to think about it and come back with some resources if I have any.
    matrixbot
    @matrixbot
    nical IIRC, the paper "A new algorithm for computing boolean operations on polygons" by Martinez et all is a good read
    Charles Lew
    @crlf0710
    @nical Thank you!
    Brendan Zabarauskas
    @brendanzab
    nannou merged in a change to use lyon for 2D tessellation! nannou-org/nannou#375
    Nicolas Silva
    @nical
    🎉
    Andreas Monitzer
    @anlumo
    @nical are you planning to attend Rustfest this year?
    Nicolas Silva
    @nical
    @anlumo I don't have plans to attend conferences so far.
    Mike Welsh
    @Herschel
    @nical How usable is the new tessellator branch? I could start switching over to it now and test it out, and file any issues I encounter if you're interested
    matrixbot
    @matrixbot
    nical It should be pretty solid. At least it can withstand fuzzing for more than 48 hours which is a lot better than the original one. There will probably be bugs but these will be found though manual testing
    nical The remaining work is to add some of the new features to the stroke tessellator and polish the API
    Mike Welsh
    @Herschel
    Great, I'll try to switch over and let you know how it goes :-)
    matrixbot
    @matrixbot
    nical Awesome, thanks!
    Mike Welsh
    @Herschel
    @nical Thanks for your quick fixes! Everything seems fine now, and all the art I was having problems with in the old tessellator seems to be working great
    matrixbot
    @matrixbot
    nical Exciting!
    Lucas Kent
    @rukai
    image.png
    I'm trying to port my code from lyon 0.14 to 0.15.
    I now implement FIllVertexConstructor instead of VertexConstructor, but im getting this error.
    matrixbot
    @matrixbot

    nical > <@gitter_rukai:matrix.org> image.png

    The signature of tessellate_path has changed, now it takes a PathSlice or something that can be converted into one. You can use FillTessellator::tessellate instead, which takes an iterator of path events.

    Lucas Kent
    @rukai
    fantastic, thanks!
    Mike Welsh
    @Herschel
    Just thought I'd share -- using lyon to do the tessellation of Flash vector art in Ruffle, rendered via WebGL on web and wgpu on desktop: http://ruffle-rs.s3-website-us-west-1.amazonaws.com/builds/web-demo/
    Thanks for lyon @nical :)
    Nicolas Silva
    @nical
    @Herschel impressive! And thanks a lot for the kind words!
    Are paths tessellated on the fly every frame?
    Mike Welsh
    @Herschel
    No, we do it once on load, so you will notice jaggies if an animation zooms way in on a shape, and particularly strokes will not be 100% accurate as zoom changes. I would like to experiment with tessellating on the fly, but I have a feeling performance will suffer for any reasonably complicated movie
    Probably more practical would be to work towards adding a Pathfinder renderer, which I will start playing with next :-)
    matrixbot
    @matrixbot
    nical Makes sense. The tessellator is pretty fast for what it does but I would have been surprised if it could handle this much geometry every frame on my phone!
    Micah
    @micahscopes
    How does lyon relate to pathfinder and piet?
    I guess the idea with lyon is to render a vector path to a polygon tessellation so that it can be drawn using conventional GPU techniques?
    matrixbot
    @matrixbot
    nical Yes pretty much. The advantages and inconvénients depend on your use case.
    Weasy
    @Weasy666

    Hello! I have a Path from a SVG file which is displayed mirrored in my Bevy application (guess this has something to do with the origin of the coordinate system) so i wanted to mirror it like this

    Path::builder()
        .with_svg()
        .transformed(Transform::scale(0.0, -1.0));

    But then it is not displayed at all. I applied a rotation .transformed(Rotation::radians(std::f32::consts::PI / 2.)) to test if i am doing something wrong, but that works. So...is it not possible to apply a negative scaling to a Path to mirror/flip it?

    Nicolas Silva
    @nical
    @Weasy666 a scale of zero on the x axis multiplies all of your x coordinates by zero, squashing your model onto the x axis. What you intended was a scale of (1.0, -1.0)
    Other than that it looks like you were on the right track.
    weasy
    @weasy:matrix.org
    [m]
    Ah...right...that absolutely makes sense! Thank you
    Nicolas Silva
    @nical
    my pleasure!
    Jesse Horne
    @jessehorne
    Hi. So it seems the code in the README is out of date. I can find no mention of FillAttributes in the entire lyon codebase
    26 | &mut BuffersBuilder::new(&mut geometry, |pos: Point, _: FillAttributes| { | ^^^^^^^^^^^^^^ not found in this scope
    Nicolas Silva
    @nical
    @jessehorne hi, yes indeed I need to update the README.
    Jesse Horne
    @jessehorne
    Oh nice! I should have checked open issues
    Holger
    @sbi_hgc:matrix.sovs.nu
    [m]
    Hello everyone. I recently started using Lyon and I really enjoy it. However I can’t figure out how to create different stroke styles like line dashing and so on. Can someone point me in the right direction?
    Nicolas Silva
    @nical
    Hi @sbi_hgc:matrix.sovs.nu , there isn't very robust way to do dashed strokes in lyon right now. If your paths are very simple you can try:
    I suspect the first method will have some distorsion artifacts when there are rather sharp turns but you'd have to try and see if it's good enough for your case. The second method is probably going to look more consistent but positioning dashes along a path is not the same as proper dashes (that bend along with the curves, etc.).
    Holger
    @sbi_hgc:matrix.sovs.nu
    [m]
    I will give it a shot. I have another question. When tessellating strokes, I need the stroke on the inside or the outside of the path. For example when adding a rounded rectangle by giving a boundingbox I need the full stroke to be on the outside of the shape. Right now I see it has equal amount of stroke on each side of the path, e.g. half the stroke width. Does Lyon support this kind of tesselating?
    Nicolas Silva
    @nical
    @sbi_hgc:matrix.sovs.nu Sort of. The stroke tessellator gives you a side and a normal in its callback that you can use to offset the vertices you create. So if you consistently build your shapes in, say, clock-wise order, you have enough information to offset the stroke inward or outward.