{"id":30602349,"url":"https://github.com/aminehabchi/drawing","last_synced_at":"2026-05-17T17:08:24.852Z","repository":{"id":310132185,"uuid":"982685988","full_name":"aminehabchi/drawing","owner":"aminehabchi","description":"Drawing various geometric shapes on a image in rust and java","archived":false,"fork":false,"pushed_at":"2025-08-15T22:46:16.000Z","size":43819,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-13T16:37:40.428Z","etag":null,"topics":["abstraction","geometry","interface","oop","polymorphism","rust","trait"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aminehabchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-13T08:59:51.000Z","updated_at":"2025-08-15T22:47:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"eee4ae14-8ec3-49d1-9670-5cad10c75c0b","html_url":"https://github.com/aminehabchi/drawing","commit_stats":null,"previous_names":["aminehabchi/drawing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aminehabchi/drawing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminehabchi%2Fdrawing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminehabchi%2Fdrawing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminehabchi%2Fdrawing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminehabchi%2Fdrawing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aminehabchi","download_url":"https://codeload.github.com/aminehabchi/drawing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminehabchi%2Fdrawing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33147340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abstraction","geometry","interface","oop","polymorphism","rust","trait"],"created_at":"2025-08-30T00:35:27.489Z","updated_at":"2026-05-17T17:08:24.847Z","avatar_url":"https://github.com/aminehabchi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust Geometric Drawing Library\n![Point Example](./art/image.png)\n\n## Overview\n\nThis project is a Rust library for drawing various geometric shapes on a raster image. The implementation uses a trait-based system for shape rendering with a clever design that separates drawing behavior from display logic.\n\n## Core Concepts\n\n### Traits\n\nThe library is built around two key traits:\n\n1. **Drawable** - Defines how shapes are drawn on an image\n   - Provides default implementation for random color generation\n   - Each shape implements its own draw method\n\n2. **Displayable** - Abstracts the actual pixel-setting operation\n   - Allows separation between drawing logic and the display medium\n   - Makes the library adaptable to different output types\n\n### Shapes\n\nThe library includes implementations for the following shapes:\n\n![Point Example](./art/space.png)\n\n**Points**: The simplest geometric element, a single pixel on the screen. Points can be created with specific coordinates or randomly generated within image bounds.\n\n![Line Example](./art/lines.png)\n\n![Line Example](./art/1milionLine.png)\n\n**Lines**: Connect two points with a line-drawing algorithm that ensures smooth lines are drawn between any two arbitrary points, handling all edge cases.\n\n![Circle Example](./art/circles.png)\n\n**Circles**: Defined by a center point and radius. The implementation uses a sophisticated algorithm to approximate a circle on a pixel grid, optimizing for visual smoothness.\n\n\n**Triangles**: Created from three points. The implementation draws three lines connecting the points to form a triangle.\n\n\n**Rectangles**: Defined by two opposite corners. The implementation draws four lines to form a rectangle aligned with the coordinate axes.\n\n![Cube Example](./art/cube.png)\n\n**Cubes**: Created from two rectangles representing the front and back faces, with connecting lines to create a 3D perspective.\n\n## Technical Highlights\n\n- **Efficient Line Drawing**: A custom algorithm that determines the most appropriate pixels to light up\n- **Random Shape Generation**: Support for creating random instances of each shape type\n- **Color Management**: Automatic random color generation for visual variety\n- **Boundary Checking**: Safe pixel plotting that respects image boundaries\n- **Modular Design**: Clean separation of concerns with traits and structs\n\n## Applications\n\nThis library can be used for:\n\n- Education: Demonstrating basic computer graphics concepts\n- Visualization: Creating simple geometric visualizations\n- Art Generation: Producing abstract geometric art\n- Game Development: Building simple 2D graphics engines\n\n## Dependencies\n\n- `raster` - For image manipulation and saving\n- `rand` - For random number generation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminehabchi%2Fdrawing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminehabchi%2Fdrawing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminehabchi%2Fdrawing/lists"}