Skip to content

Some work on Tesselator#165

Merged
tpaviot merged 1 commit intotpaviot:masterfrom
rainman110:ms/tesselator
Dec 12, 2015
Merged

Some work on Tesselator#165
tpaviot merged 1 commit intotpaviot:masterfrom
rainman110:ms/tesselator

Conversation

@rainman110
Copy link
Collaborator

  • Computation of edges
  • Interface to Vertices, Normals, and Triangles

@jf---
Copy link
Contributor

jf--- commented Dec 11, 2015

Cool!
An interface to Edges could be useful too, right?
I think now in python you'd have to do lots of iteration to get all edges?

The ipython work is exciting...

@rainman110
Copy link
Collaborator Author

I think now in python you'd have to do lots of iteration to get all edges?

Unfortunately yes. It would be better, if the swig interface already returns the whole array instead of iterating over each vertex.

The workflow is as follows:

  • Tesselate
  • Iterate over vertices of faces and edges
  • Put all vertices in dictionaries
  • Transmit dictionaries to javascript using the ipython bridge
  • In javascript: put everything into three.js objects (again for loops)

This might be the reason, why my code is quite slow. There is probably some room for optimization though.

@jf---
Copy link
Contributor

jf--- commented Dec 11, 2015

Ah, thanks for the insight @rainman110

To make this fast, probably we could create a .json string in pythonocc, where iteration through the mesh is handled in C++ and the .json returned through the SWIG interface.

But this is a nice step fwd!

@rainman110
Copy link
Collaborator Author

Good idea! Should be much faster.

@rainman110
Copy link
Collaborator Author

There seem to be build problems with the Tesselator. I will have a look into it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting these lines was by accident, sorry.

- Computation of edges
- Interface to Vertices, Normals, and Triangles
@tpaviot
Copy link
Owner

tpaviot commented Dec 12, 2015

Greta, interface to vertices/faces/edges was something requested for a while.

We should add an example now.

tpaviot added a commit that referenced this pull request Dec 12, 2015
@tpaviot tpaviot merged commit 2178618 into tpaviot:master Dec 12, 2015
@rainman110
Copy link
Collaborator Author

What about an example, where we plot a shape with matplotlib? There we can explicitly use the tesselator to get the triangles and edges.

@jf---
Copy link
Contributor

jf--- commented Dec 14, 2015

Initially the tesselator was put in place for generating mesh data to be rendered in webgl.
I think keeping the context of webgl or opengl is where this functionality is most applicable.

@tpaviot
Copy link
Owner

tpaviot commented Dec 14, 2015

The Tesselator can be used to solve any problem. So far actually the Tesselator is mostly used to render a shape in the browser, but if it can be used for something else, it's cool too. I use to work with numpy/matplolib, an example demonstrating a use of pythonocc/matplotlib would be great IMHO.

@rainman110
Copy link
Collaborator Author

I just added a small matplotlib example for the tesselator. I think this is more instructive than a huge opengl/webgl code. See my PR #167

@jf---
Copy link
Contributor

jf--- commented Dec 14, 2015

@rainman110 , I just saw your PR...
Yes, the MPL example is really cool... sorry I didnt realize this was a good idea before...

@tpaviot tpaviot mentioned this pull request Dec 24, 2015
@rainman110 rainman110 deleted the ms/tesselator branch January 11, 2016 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants