GithubHelp home page GithubHelp logo

vihdzp / miratope-rs Goto Github PK

View Code? Open in Web Editor NEW
56.0 3.0 15.0 22.63 MB

A tool for building and visualizing polytopes.

License: MIT License

Rust 98.37% GLSL 1.63%
polytopes rust shapes rendering polytope

miratope-rs's Introduction

A tool for building and visualizing polytopes. Still in alpha development. Fork of vihdzp/miratope-rs focused on building concrete polytopes like uniforms and nobles.

Library

The default library contains:

The library is customizable, you can add your own .off files. Sometimes you may need to delete or modify the .folder files though.

Features

  • Building polytopes
  • Operations on polytopes
  • Analyzing polytopes
    • Miratope can compute various properties of polytopes, such as flag count, orientability, circumsphere, volume, and symmetry group.
    • It can display a list of all elements of a polytope, grouped by symmetry equivalence.
    • It can split compounds into their components.
  • Rendering polytopes
    • Miratope can render wireframes and faces (both toggleable) of polytopes in arbitrary dimension, though it can currently only rotate in 3 dimensions. It can render in perspective and orthogonal projection. It can also interactively render cross-sections of polytopes.
  • Importing and exporting polytopes in the .off format

How to use

If you're using 64-bit Windows

Just download the latest release on the right side of the github page, extract the zip, and run miratope.exe.

If you're using a different OS, or you want to modify the source code

Miratope is written in Rust, so if you don't already have the latest version and its Visual Studio C++ Build tools downloaded then you should do that first. Instructions for downloading can be found here: https://www.rust-lang.org/tools/install. You may have to restart your computer for Rust to fully install.

  1. Once you have Rust setup click the green button here on Github that says "Code".
    • If you already have Github Desktop, you can just click "Open with Github Desktop".
    • If you don't, click "Download ZIP" and once it's done downloading, extract the .zip file.
  2. Next, open a command line. On Windows you can do this by opening Run with Win+R and typing cmd in the search box.
  3. In the command line, first type cd [FILE PATH]. If you don't know how to get the file path, in your files go open the unzipped Miratope file folder, and click on the address bar at the top. Copy the highlighted file path and paste it into the command line in place of [FILE PATH], and press Enter. The last name in the command header should now be the name of the folder Miratope is in.
  4. Finally, type cargo run --release and hit Enter. It will take a while for the computer to open Miratope for the first time, but after that, opening it should be a lot faster. A window should appear, if the version of Miratope you downloaded was a stable one. If it wasn't, you'll get an error, and you should wait until the devs have fixed whatever they broke.

Once you have completed all the steps you will only need to do step 4 to run Miratope from startup (but if the [FILE PATH] changes, you'll need to do step 3 again).

There is currently an issue with the dependency wgpu-core not compiling on the latest version of Rust. The command rustup default 1.59 to change to an older version should fix it.

If you have downloaded Miratope previously, updated to the most recent version, and are getting an error like "error[E0710]: an unknown tool name found in scoped lint" in the console, this means a crate that Miratope uses has gone out of date. Don't worry about what that means, just make sure your command line has the header pointed at Miratope (like in step 3), and type rustup update in the console. Cargo, Rust's built-in file handler, will automatically update all the crates Miratope uses which should fix the issue. If this still doesn't fix it, contact the devs in the #miratope channel on Polytope Discord.

miratope-rs's People

Contributors

galoomba1 avatar h-a-m-g-e-r avatar legionmammal978 avatar lllllllllwith10ls avatar ocornoc avatar plasmath avatar vihdzp avatar zerocumulus 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

Watchers

 avatar  avatar  avatar

miratope-rs's Issues

Add volume function

To compute the volume of a polytope, we need to first check for planarity, then build an oriented simplex for each flag and add up all of their areas. The part of the oriented simplices might be made easier if we first made some sort of iterator object over flags of a polytope (which might then be reusable for other functions).

Add autogenerated names of polytopes + localization.

This is a feature that had already been considerably worked into Miratope JS. We'll need to rethink a few key aspects, particularly which crate we'll use for localization, exactly what will get translated, how we'll store names internally, and what we'll assume about the grammar of languages we'll localize Miratope into.

Make Cross-section button display correct polytope

As described in the title, sometimes the wrong polytope is displayed. Instructions for replication are as follows:

  1. Enter cross-section mode on any polytope
  2. Load a different .off file
  3. Press the cross-section button again

This loads sections of the previous polytope instead.

Using menus closes them

Os: Linux Raiku 5.11.21-hardened1-2-hardened #1 SMP PREEMPT Fri, 14 May 2021 21:06:07 +0000 x86_64 GNU/Linux

Miratope version git hash: 70811e1

Problem:

Whenever browsing through a menu it closes even if it isn't a leaf.

VIdeo: https://youtu.be/iHyF1gcDy4g

Mac and Linux users + A few revisions for Readme

As a newcomer for Rust and a full-time Linux user, (I have NPM knowledge), I originally had trouble cargo-running the application due to Failed to run ```"pkg-config" "--libs" "--cflags" "glib-2.0" "glib-2.0 >= 2.48": No such file or directory (os error 2)```.

I am wondering how can I resolve this problem?

Edit You need to install a GTK, ATK, package

Update I realized some of the variables did not live long enough.

mulliganaceous@MULLIGANACEOUS2:/media/mulliganaceous/Mulliganaceous_S/Gits/miratope-rs$ cargo run
   Compiling wgpu-core v0.9.2
   Compiling xcb v0.8.2
   Compiling bevy_winit v0.5.0 (https://github.com/bevyengine/bevy?branch=main#e74f7a73)
   Compiling stretch v0.3.2
   Compiling bevy_text v0.5.0 (https://github.com/bevyengine/bevy?branch=main#e74f7a73)
   Compiling bevy_scene v0.5.0 (https://github.com/bevyengine/bevy?branch=main#e74f7a73)
   Compiling gio-sys v0.14.0
error[E0597]: `desc_set` does not live long enough
    --> /home/mulliganaceous/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.9.2/src/device/mod.rs:1792:26
     |
1792 |                     set: desc_set.raw_mut(),
     |                          ^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
...
1813 |     }
     |     -
     |     |
     |     `desc_set` dropped here while still borrowed
     |     borrow might be used here, when `write_map` is dropped and runs the `Drop` code for type `BTreeMap`
     |
     = note: values in a scope are dropped in the opposite order they are defined

For more information about this error, try `rustc --explain E0597`.
error: could not compile `wgpu-core` due to previous error
warning: build failed, waiting for other jobs to finish...

Sections of abstract polytopes

Some code to generate a section of an abstract polytope (from the ranks of the elements and its indices, say) would be nice. It would also allow us to grab concrete elements or element figures (though we might want to do these separately, as most likely the code will be both faster and easier).

Add multiple views

Currently, we can only visualize one polytope at a time. Would be nice to be able to visualize various polytopes, and maybe things that aren't exactly polytopes like abstract polytope graphs.

UI allows selecting invalid input

How to reproduce?

Go to Uniform Antiprisms in the library. Set d = 2. Then drag n down to 2. Even though d is now visually updated as 1, it still holds the value 2, which makes Miratope crash as a {2 / 2} polygon isn't valid. Setting d = 1 and then n = 2 works fine.

We should check which other inputs have this issue.

Fully separate the core code of `miratope`

Currently, Miratope consists of lots of complex polytope building code, and lots of complex polytope rendering code. We ought to separate these so that the crate is easier to use by others.

Before this separation is fully complete, there's a few things we need to sort out:

  • Verify that the public and private parts of the API make sense.
  • Feature-gate all parts of the code that might not be strictly helpful.
  • Feature-gate the abstract name representations and the language module.
  • Add thorough documentations.

Color info in OFF files

Stella sometimes bundles color info in OFF files, which screws up the parsing. In fact, it screws up the entire format, because the parser treats newlines as any other whitespace. We need to add some sort of flag to the OFF parser so that if the file "comes from Stella," it separates elements by newlines, and reads only the correct amount of elements from each line.

Cross-section bugs

This is a sort of follow up to #23. Currently, cross-sections have two major bugs, and something else we should figure out:

  • Cross-sections of polytopes in less than 2D generate invalid polytopes.
  • A cross-section passing through an element can give unpredictable and sometimes invalid results.
  • Petrials' cross-sections are weird (obviously, they weren't meant for this)

Function to make CDs into polytopes

This would be a really nice feature, though a difficult one to implement. There are quite a few things we'll need to do first:

  • Parse CDs into graphs.
  • Add a way to generate "snub" groups.
  • Formalize what CDs even mean mathematically.
  • Put everything together.

Improve accessability

Decrease the amount of actions required to open miratope, i.e porting miratope to WASM or a downloadable; This issue will be for after most of the other issues are solved or the project is considered public and finished.

E6 test fails on Mac OS half of the time

No idea why this happens? Says something about 16 not equaling 0. We could figure out how to set the backtrace in GitHub actions and use this to see exactly where the error lies.

Fix convex hulls

The current convex hull code works only when all of the facets of the polytope are simplices. We ought to make it work in more general settings. We could implement Quickhull to do this.

Fix OFF exporting in low dimensions

In 2D, OFF files write the single face instead of the components. We haven't checked what the code does in 1D and lower. This is a regression that was introduced when we changed the internal format of polytopes.

Compilation error

When I try to compile miratope, I get this error

Compiling crossbeam-epoch v0.9.5
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /Users/adamnemecek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.47/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

   Compiling crossbeam-utils v0.8.5

Group elements by type, show more info for elements, GUI feature to load specific elements or figures

The info would be:

  • element counts of the element, maybe in the long term the name of the polytope (#15)
  • info of the element figure
  • measures like volume (#16)

Not sure how grouping by type would be done, probably using heuristics like Stella does. There was talk about using graph isomorphism to check which abstract polytope it is

I'm thinking of, for each element type, have a button to load it in the secondary view. Currently we don't even have the secondary view yet... (#17) This would also require reworking the element counts code a bit.

Improve triangulation algorithm

Currently, we triangulate a polygon by simply going around it clockwise. This works fine for convex polygons but fails spectacularly for nonconvex ones. We should implement a better triangulation algorithm, hopefully from some crate, to be able to do both binary filling and density filling.

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.