dimforge / dimforge/kiss3d

Consider `impl Into<PointX<_>>` in kiss3d API

Open
#237 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.8k
Forks
194
Avg merge
1d 14h
Merged PRs (30d)
2

Description

A series of `From` traits are defined on `Point` type ([doc](https://docs.rs/nalgebra/0.21.1/nalgebra/geometry/struct.Point.html#impl-From%3C%5BN%3B%201%5D%3E)). We could combine it with `impl Into>` to help user to write more compact syntax.

For example, the [Window::draw_line](https://docs.rs/kiss3d/0.24.1/kiss3d/window/struct.Window.html#method.draw_line) receives a pair of point and color. We can turn it to the following.

```rust
pub fn draw_line(
&mut self,
a: impl Into>,
b: impl Into>,
color: impl Into>
)
```

In this way, we can call by `window.draw_line([0.0, 0.0, 0.0], [0.8, 0.8, 0.8], [1.0, 1.0, 1.0])` instead of `Point3::new()` everywhere.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Window::draw_line and compare its current signature with nalgebra's Point From implementations linked in the issue. Check the surrounding window API and existing tests or examples; done means the intended point and color inputs compile in the compact array form without breaking existing calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, computer-graphics
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.