arpastrana / apc524_directional_clustering Goto Github PK
View Code? Open in Web Editor NEWFinal Project for APC524 at Princeton University
License: Other
Final Project for APC524 at Princeton University
License: Other
Refactor original cosine-based kmeans into an object called CosineKmeans" that complies with the API set by
ClusteringAlgorithm` ABC.
Create a VectorField class, with relevant methods, according to the API
As a [role], I want [something] so that [benefit].
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Refactor align_vectors
and smoothen_vectors
into their own functions. These must be contained into their own submodule accessed as directional_clustering.transformations.
Describe the bug
I was trying to get attributes of a face using mesh.face_attribute(fkey)
or mesh.face_attributes(fkey)
, but neither way worked.
mesh.face_attribute(fkey)
: An error came up missing 1 required positional argument: 'name'
mesh.face_attributes(fkey)
: returned an empty dictionary
To Reproduce
My code is:
import os
from compas.datastructures import Mesh
from directional_clustering import JSON
name_in = "perimeter_supported_slab.json"
JSON_IN = os.path.abspath(os.path.join(JSON, name_in))
mesh = Mesh.from_json(JSON_IN)
fkey = mesh.get_any_face()
attr = mesh.face_attributes(fkey)
print(len(attr))
Currently building a basic code, will look on which parts of the packages I need for which parts. Will push to the developer branch.
As a [role], I want [something] so that [benefit].
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
To Reproduce
invoke docs
The error I get is
app.add_directive('plot', plot_directive, True, (0, 2, False), **options)
TypeError: add_directive() got an unexpected keyword argument 'alt'
It is very similar to the one described here: sphinx-doc/sphinx#7659
One of the comments describes exactly the error I copied above.
The solution I found
... was to downgrade sphinx to 2.4, because, for some reason, I can't upgrade matplotlib to anything above 3.0.3. Does anyone have a clue why this is happening?
Bonus problem!
When invoke docs
finally works, I can't find any of our documentation in the HTML, only the headers.
For this issue, I believe it is simply because I haven't spent much time yet figuring out how sphinx works. But I thought it would be good to include this part here anyways in case someone already knows what's up with it.
Additional context
I'm running Windows 10, with windows cmd prompt, inside conda env. clusters.
I've added the new plotter to the plotters branch and it would be great if someone could see it (:eyes: @arpastrana) before I continue making progress. My next steps are to add tests and make a PR before continuing to expand the plotting options, or changing it into a class rather than functions.
Install plotly.py with:
$ pip install plotly==4.13.0
$ conda install -c plotly plotly=4.13.0
See if script 01_directional_clustering.py works
Simply run that script to see if a new tab opens in your browser to show the interactive graph. You can change the plotter flags at the top of the script - there is an added option to draw mesh edges or not.
Overleaf: Plotters
For curiosity: there is a file inside our Overleaf report folder with a detailed description of why I chose plotly.py package, along with the issues and solutions I found. I made that mainly to organize my own work process, but it may be useful to others since I had to do quite some digging in forums and documentation to find the solutions I was looking for.
After wrapping an existing open-source FEA library, create an interface object called StructuralModel() that takes in loads, support conditions, and a Mesh(), and returns a sequence of valid user-defined VectorField() objects.
variational_clustering is not being installed with the current version in branch develop.
Error:
ModuleNotFoundError: No module named 'variational_clustering'
After wrapping an existing open-source FEA library, create an interface object called StructuralModel() that takes in loads, support conditions, and a Mesh(), and returns a sequence of valid user-defined VectorField() objects.
I believe one of the latest commits may have broken the vector field array.
I'm looking into it, and hope to find a solution, but please let me know if you have a hint on where it may have gone wrong!
Thanks :)
When I set draw_vector_fields = True
his error happens:
Traceback (most recent call last):
File "01_directional_clustering.py", line 285, in <module>
plotter.draw_vector_field_array(va, (50, 50, 50), True, 0.07, 0.5)
File "c:\users\(...)\apc524_directional_clustering\src\directional_clustering\plotters\cluster_plotter.py", line 39, in draw_vector_field_array
rows, cols = field.shape
AttributeError: 'VectorField' object has no attribute 'shape'
A mesh object that can host different vector fields. For every vector field, only one vector can be assigned per mesh face. Our Mesh() should be a subclass of compas.datastructures.Mesh.
Adding all changes implemented for alpha version on overleaf document. Will have it by 5pm EST.
Create a separate branch, and set @Alexandros101 final report's repo as a remote (Which is synced to Overleaf
Automatically "comb" (i.e. smartly align) a disoriented vector field on a mesh. Use one of libigl
's existing functions to this end.
Write down a factory class that instantiates clustering methods on the fly. The creation part should only consider methods that inherit from the abstract base class. For a reference, we can go back to APC524's assignment 02, where we could select among different integrators
As a [role], I want [something] so that [benefit].
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
To Reproduce
invoke docs
The error I get is
compas_template is not installed.
The solution I found
... was to pip install sphinx-compas-theme
.
Question
Should we add it to requirements.txt
?
A viewer that displays multiple meshes and multiple vector fields simultaneously in 3d space
Check the aforementioned script and create a command-line interface (likeddo.c
in assignment 2) which allows a user to run script 01_directional_clustering.py from the terminal (or anaconda prompt on Windows).
We may want to look at things like argparse
in Python to make sense to how to pass in arguments to the script directly. A very cool library to do this instead is python-fire
. Check it out here: https://github.com/google/python-fire
By implementing the CLI, we will see more clearly what is needed to set up an adequate API.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.