I use SymPy's geometry module for geometric stuff. I need OBBs but so far I could not came across this feature in SymPy. Does SymPy really provide OBBs? If not is there a module to download as I do not want to re-code.
Related
I am working on a Clojure program that is in need of using 3D graphics and for that I am using Quil. The first question I have is are there alternatives using Clojure to Quil? As far as I can tell it seems like the most advanced processing library I could find.
Having asked that, my second question is using Quil (which is based on a Java framework called Processing) what is the best way to add other 3 dimensional primitives. I want to add in a Cylinder, a Cone, and a Torus. I believe my Math and Programming skills are up for the challenge but I need some help on how I should contribute.
First off, if I am to go about adding those primitives, should I add them in Processing or should I add them into Quil? I have been programming for a while but haven't contributed for a bit to open source projects. Having said that, if anyone uses Quil, if I were to use the Vertex commands such as 'begin-shape' in Clojure, would I be able to make a Cylinder with triangle vertices? It says that the shape can not work with 'translate' but would it work with 'with-translation'?
In general I looking for the best way to approach adding 3D primitives to Quil and due to the nature of the code, cannot use Clojurescript so I need to add them for Clojure. Any help is greatly appreciated.
Cheers,
It seems that the functions are implemented only for ClojureScript at this time due to a recent migration from a dependency that was no longer being maintained? See this commit and https://github.com/quil/quil/issues/255
Here's a ClojureScript example of a Torus.
I am looking for a way of approximating a surface based on a set of 3D data points. For this purpose I would like to use a method based on radial basis functions but I cannot find a free implementation in C++.
I looked in ITK, VTK and open CV but I did not find anything...
Does anyone knows a free implementation of such an algorithm ?
Any suggestion about the reconstruction of a surface based on a set of 3D data points is also more than welcome ! :)
3D surface reconstruction can be challenging. I would first recommend taking a look at PCL. The Point Cloud Library has grown into a nice set of tools for 3D point management and interpretation, and its license and API sound compatible with your needs. The surface reconstruction features of the library appear to be most applicable. In fact, RBF reconstruction is supported.
If PCL doesn't work, there are other options:
MeshLab,
This SO post provides a nice summary, and
of course, Wikipedia provides some links
Finally, you might search CiteSeerX, Google Scholar, etc. for papers like this one. As an example, a search for "3D Surface Reconstruction" at CiteSeerX yields many hits. RBF-based reconstruction is just one of many methods: is your application truly limited to radial basis functions? If not, there are many choices, (i.e. Ball Pivoting Algorithm). See this survey paper for some comparisons.
I am wondering whether there is any existing library or software which is on tetrahedral mesh simplification and written in C/C++. You may know that there is a famous algorithm on triangular mesh based on Quadric Error Metrics, called Surface Simpliļ¬cation Using Quadric Error Metrics. I reckon there should be something similar but applied to tetrahedral mesh. Thanks!
You should probably search in CGAL library CGAL. Its the best for computational geometry algorithms. I am sure that someone should have already implemented mesh simplification in CGAL.
The closest I can find to what you are looking for exists here it allows tetrahedral volumetric rendering.
Not sure if this is what you are looking for, as the original question and the comments seem to differ slightly in the end aim.
Let me know if you need any further info:)
I am working on a text classification problem using scikit-learn classifiers and text feature extractor, particularly TfidfVectorizer class.
The problem is that I have two kinds of features, the first are captured by the n-grams obtained from TfidfVectorizer and the other are domain specific features that I extract from each document. I need to combine both features in a single feature vector for each document; to do this I need to update the scipy sparse matrix returned by TfidfVectorizer by adding a new dimension in each row holding the domain feature for this document. However, I can't find a neat way to do this, by neat I mean not converting the sparse matrix into a dense one since simply it won't fit in memory.
Probably I am missing a feature in scikit-learn or something, since I am new to both scipy and scikit-learn.
I think the easiest would be to create a new sparse matrix with your custom features and then use scipy.sparse.hstack to stack the features.
You might also find the "FeatureUnion" from the pipeline module helpful.
I'm a newbie in this type of approach to programming since I really doesn't care for hardcore graphics generation. I design, write, run, and study parametrized climate models with python. But, at last, I have encountered myself with a visualization issue.
I was looking for something in Cairo library that allows me to map a linear gradient onto an arbitrary curve (not necessarily a circumference) such that there is a more or less smooth variation of colour (or shade) across my path. Then I have been looking for some pattern and I finally found that maybe mesh gradients in Cairo are the solution.
However, I can't create a new mesh gradient from my python script with cairo.pattern_create_mesh()!
Therefore, my questions are: How I use mesh gradients in Cairo? Is there any other simple way to do what I want with Cairo (I don't know, like a simple mapping from a line segment to a curve via parametrization, I know I ask too much)?
Mesh patterns were added in cairo 1.12 which is the latest release. Thus, most language bindings likely don't support them yet. I don't know anything about the combination of python and cairo and thus don't know any workaround.
I don't know any simple way to simulate what you need with other patterns, sorry. (Although I am not really sure how you want to do your mapping via mesh gradients either...)