Giter VIP home page Giter VIP logo

line_drawing's Introduction

A collection of line-drawing algorithms for use in graphics and video games.

Currently implemented:

line_drawing's People

Contributors

atouchet avatar chitalian avatar dependabot-preview[bot] avatar expenses avatar fauxfaux avatar heroickatora avatar tversteeg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

line_drawing's Issues

Antialising?

Thanks for your crate, it is pretty useful. I wonder whether you have any tips on how to avoid hard edges?

XiaolinWu can't draw horizontal lines

A line from (1,10) -> (7,10) seems to end at (7,16).

Is this supposed to work? I've never used a packaged version of this algorithm before. I realise that perhaps I should optimise this case (to a pixel fill).

The line comes out as this, which I don't believe to be what I wanted:

#[test]
fn line2() {
    let wu: line_drawing::XiaolinWu<f32, isize> = line_drawing::XiaolinWu::new((1., 10.), (7., 10.));
    assert_eq!(
        vec![
            (1, 10),
            (2, 11),
            (3, 12),
            (4, 13),
            (5, 14),
            (6, 15),
            (7, 16),
        ],
        wu.into_iter().map(|(pt, _)| pt).collect::<Vec<_>>()
    );
}

Code doesn't build with latest rand 0.6.5

error[E0432]: unresolved import `self::rand::distributions::range`
 --> src/fuzzing.rs:6:32
  |
6 | use self::rand::distributions::range::SampleRange;
  |                                ^^^^^ could not find `range` in `distributions`

warning: use of deprecated item 'fuzzing::rand::ThreadRng': import with rand::prelude::* or rand::rngs::ThreadRng instead
  --> src/fuzzing.rs:19:30
   |
19 | fn random_point<T>(rng: &mut rand::ThreadRng, range: T) -> Point<T>
   |                              ^^^^^^^^^^^^^^^
   |
   = note: #[warn(deprecated)] on by default

warning: use of deprecated item 'fuzzing::rand::ThreadRng': import with rand::prelude::* or rand::rngs::ThreadRng instead
  --> src/fuzzing.rs:26:30
   |
26 | fn random_voxel<T>(rng: &mut rand::ThreadRng, range: T) -> Voxel<T>
   |                              ^^^^^^^^^^^^^^^

error: aborting due to previous error

no_std support?

I came across this crate and it seems really useful, but I don't see any support for no_std. Does anything in this crate rely on std? I'd love to be able to use this, but I'm restricted by no_std. Would it be viable to add no_std support? No worries if this isn't possible, but I figured I'd ask.

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.