Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pythonocc and Flask #1325

Open
cesarecaoduro opened this issue May 14, 2024 · 1 comment
Open

Pythonocc and Flask #1325

cesarecaoduro opened this issue May 14, 2024 · 1 comment

Comments

@cesarecaoduro
Copy link

I’m wondering if anyone has tried to create a REST api that exposes functionalities from pythonocc.
Something similar to what Rhino Compute does with Rhino and Grasshopper.
I’ve quickly tried today to create an endpoint to expose the creation of an edge based on 2 points, trying to use gp_Pnt as input type and TopoDS_Edge as return object, but obviously that didn’t work.
Now I can create some DTO to wrap the coordinates of a point, but it becomes a lot more complex to start wrapping an edge.
Ultimately I was trying to have a few endpoints to create a series of edges and pass them to another endpoint to create a wire, to finally extract a point along the wire.
All of this pretty straight forward from a coding perspective, but not as straight forward if you want to create a geometry kernel as a service.
Thoughts?
This might really be game changer as I think also at the implication can have with other libraries like IfcOpenshell.
Cheers!

@tpaviot
Copy link
Owner

tpaviot commented May 14, 2024

As far as I know, there have been some limited scope services implemented, and it's quite easy. A wider scope REST API would certainly be more difficult, but the main question for me is: for what purpose? pythonocc is easily deployable on any machine, free to use and redistribute. I can't see any advantage in moving from a Python script that runs on my machine to a small granularity geometry service (e.g., make a set of points, then a spline, then extrude the spline) that would run in the cloud. This situation is different for dedicated services which are not part of pythonocc, require heavy computations, and could be offered as paid services in a saas mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants