Generating coil spring drawings from a web application

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
mani_gs
Posts: 1
Joined: Thu Apr 30, 2020 3:46 am

Generating coil spring drawings from a web application

Post by mani_gs »

Dear Friends,
I am new to FreeCAD. I am developing a Web application for designing coil springs (Compression, tension, torsion). Like this one (this is in the early stage of development) https://mani-developer.github.io/springdesigner/ . Instead of having a static image of the spring, we would like to generate the drawing using FreeCAD based on the customer input parameters and display the same on the screen (either as image or pdf). Have any one tried anything similar to this ? Could you please guide me on how to proceed ?
mario52
Veteran
Posts: 4690
Joined: Wed May 16, 2012 2:13 pm

Re: Generating coil spring drawings from a web application

Post by mario52 »

hi

c'est beau ça

for FreeCAD i make this macro Macro_FCSpring_Helix_Variable and simulate animation Macro_Spring (without sweep)

convert it in Java ...

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

Re: Generating coil spring drawings from a web application

Post by amrit3701 »

mani_gs wrote: Thu Apr 30, 2020 3:56 am Dear Friends,
I am new to FreeCAD. I am developing a Web application for designing coil springs (Compression, tension, torsion). Like this one (this is in the early stage of development) https://mani-developer.github.io/springdesigner/ . Instead of having a static image of the spring, we would like to generate the drawing using FreeCAD based on the customer input parameters and display the same on the screen (either as image or pdf). Have any one tried anything similar to this ? Could you please guide me on how to proceed ?
Hi,

I did a lot of similar stuff, run FreeCAD at backend and show recomputed model to user on web browser.

I suggest you to use https://hub.docker.com/r/amrit3701/freecad-cli docker image for your web application. In this image, I compiled FreeCAD without GUI and it gives better performance.

You can use OBJ format as communication between FreeCAD and Web.

To render OBJ file on web browser you can use Three.js. Here is the example of how to load OBJ file in three.js (https://threejs.org/docs/#examples/en/loaders/OBJLoader)

How does the whole cycle work? :?:
Get parameter from frontend -> Change parameter values in FreeCAD -> Recomputed model -> Export OBJ file -> Send OBJ file to frontend -> Three.js load OBJ file and render your model on web browser.

Thanks,
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Generating coil spring drawings from a web application

Post by Kunda1 »

amrit3701 wrote: Thu Apr 30, 2020 9:37 am I suggest you to use https://hub.docker.com/r/amrit3701/freecad-cli docker image for your web application. In this image, I compiled FreeCAD without GUI and it gives better performance.
@amrit3701 Nice!
Perhaps we can add this to Compile_on_Docker or some variant page?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Generating coil spring drawings from a web application

Post by bernd »

amrit3701 wrote: Thu Apr 30, 2020 9:37 am I did a lot of similar stuff, run FreeCAD at backend and show recomputed model to user on web browser.
wow cool, is an example available on the internet?
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Generating coil spring drawings from a web application

Post by abdullah »

amrit3701 wrote: Thu Apr 30, 2020 9:37 am
How does the whole cycle work? :?:
Get parameter from frontend -> Change parameter values in FreeCAD -> Recomputed model -> Export OBJ file -> Send OBJ file to frontend -> Three.js load OBJ file and render your model on web browser.

Thanks,
Even for somebody so far away from web applications as me, this really sounds cool! :)
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Generating coil spring drawings from a web application

Post by sliptonic »

CADCloud is the most advanced FreeCAD-powered web application I've seen so far.
The production reference implementation is at justyour.parts.

Here's a torsion spring project I made. The 3D view shows a rendering problem that I think has been resolved now.

The github repo can be found at https://github.com/CADCloud/CADCloud

A gitter community to discuss it also exists.

@vejmarie is the guy to know.
vejmarie wrote: ping
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

Re: Generating coil spring drawings from a web application

Post by amrit3701 »

bernd wrote: Thu Apr 30, 2020 4:18 pm wow cool, is an example available on the internet?
No, I created apps for commercial companies and all the things are closed source. :( Anyway, now I am thinking to create a most simple FreeCAD web-based project which illustrates how to use FreeCAD as a CAD engine for 3D web application and share here soon.
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Generating coil spring drawings from a web application

Post by vejmarie »

amrit3701 wrote: Mon May 04, 2020 8:26 am
bernd wrote: Thu Apr 30, 2020 4:18 pm wow cool, is an example available on the internet?
No, I created apps for commercial companies and all the things are closed source. :( Anyway, now I am thinking to create a most simple FreeCAD web-based project which illustrates how to use FreeCAD as a CAD engine for 3D web application and share here soon.
@bernd, and @amrit3701 this is closed to what CADCloud is doing except I am using xeogl as a renderer for the Wavefront OBJ object. We can easily re-implement amrit3701 idea. It is not the intend of CADCloud which is targeting more a github for open hardware project, but that might be a funny feature to add. Latency might be the challenge.
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Generating coil spring drawings from a web application

Post by vejmarie »

sliptonic wrote: Sun May 03, 2020 5:52 pm CADCloud is the most advanced FreeCAD-powered web application I've seen so far.
The production reference implementation is at justyour.parts.

Here's a torsion spring project I made. The 3D view shows a rendering problem that I think has been resolved now.

The github repo can be found at https://github.com/CADCloud/CADCloud

A gitter community to discuss it also exists.

@vejmarie is the guy to know.
vejmarie wrote: ping
Thanks for the support. Your bug is going to be fixed pretty soon. I am using on the server side the FreeCAD snap that I maintain (got more than 20k users now !). I just updated it to 0.19 (was soon running 0.19) but with many enhancement like OCCT 7.4 (which was required to fix the mesh generation of the Torsion Spring), qt5, python3 and latest master commit. I just finished to polish it tonight and released it on the snap store as a latest/release.
Post Reply