[Sketcher Geometry] - Export/Import between FreeCAD and Blender

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!
Post Reply
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

[Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by paullee »

abdullah wrote: Ping
realthunder wrote: Ping
There is a discussion at OSArch about "a Constraint-based sketcher addon for Blender that allows to create precise 2d shapes by defining a set of geometric constraints like tangent, distance, angle, equal and more. Sketches stay editable and support a fully non-destructive workflow" in Blender.

Wondering if the sketcher information is interchageable between FreeCAD and Blender, @DADA_universe comments :-

"There might be something to this question, I see that Geometry Sketch is based on a fork of SolveSpace (on which Geometry Sketcher is based) by Real Thunder, better known for his more intuitive fork of FreeCAD. Indeed there might be something there to explore for interoperability between FreeCAD and Blender for starters and other cad tools by extension, with the 'sketch' being the vehicle that conveys the required CAD data between the different tools."

Something can do and worth doing so? Thanks :)


[EDIT - Added animated image link to OSArch discussion]

Image
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by realthunder »

FreeCAD sketch solver is a dedicated 2D solver. I think there are quite a few constraints that has no direct mapping to SolveSpace. In other word, mapping from blender sketch to FreeCAD's should be doable, but not the other way around.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by realthunder »

I haven't looked into the blender plugin yet, but since SolveSpace is a 2D/3D solver, have they implemented 3D sketch capability yet? That'll be very interesting. There are quite a few people wishing for 3D sketch in FreeCAD as well.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
hlorus
Posts: 30
Joined: Sun Oct 17, 2021 9:47 am

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by hlorus »

Hey there!
realthunder wrote: Sun Oct 17, 2021 7:41 am FreeCAD sketch solver is a dedicated 2D solver. I think there are quite a few constraints that has no direct mapping to SolveSpace. In other word, mapping from blender sketch to FreeCAD's should be doable, but not the other way around.
I think it would be reasonable to only support exporting from Blender to Freecad, this would probably be the main use-case anyway. As BGS is based on solvespace it might make sense to use the solvespace format for exchanging. Is it already possible or planned to import .slvs files into FC? Another approach could be to have a direct importer similar to blender's FreeCAD Importer however that would require matching python versions.
realthunder wrote: Sun Oct 17, 2021 7:44 am I haven't looked into the blender plugin yet, but since SolveSpace is a 2D/3D solver, have they implemented 3D sketch capability yet? That'll be very interesting. There are quite a few people wishing for 3D sketch in FreeCAD as well.
Not yet, BGS is still in an experimental state. Currently i'm focusing on 2d sketching but 3d could be interesting to explore at some point.
drmacro
Veteran
Posts: 8806
Joined: Sun Mar 02, 2014 4:35 pm

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by drmacro »

A Blender import FreeCAD addon exists. It has a thread here in the forum

https://github.com/s-light/io_import_fcstd

I've used it, with success.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
hlorus
Posts: 30
Joined: Sun Oct 17, 2021 9:47 am

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by hlorus »

drmacro wrote: Sun Oct 17, 2021 11:28 am A Blender import FreeCAD addon exists. It has a thread here in the forum

https://github.com/s-light/io_import_fcstd

I've used it, with success.
Yeah i'm aware of that addon however this topic is specifically about import / export of sketcher geometry and constraints, not about final geometry.
drmacro
Veteran
Posts: 8806
Joined: Sun Mar 02, 2014 4:35 pm

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by drmacro »

hlorus wrote: Sun Oct 17, 2021 3:14 pm
drmacro wrote: Sun Oct 17, 2021 11:28 am A Blender import FreeCAD addon exists. It has a thread here in the forum

https://github.com/s-light/io_import_fcstd

I've used it, with success.
Yeah i'm aware of that addon however this topic is specifically about import / export of sketcher geometry and constraints, not about final geometry.
I understand that as well. I guess my thought was, it might not be much effort to get it to import sketches.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by paullee »

Thanks @realthunder for comments and @hlorus joining the discussion here :)
hlorus wrote: Sun Oct 17, 2021 10:19 am I think it would be reasonable to only support exporting from Blender to Freecad, this would probably be the main use-case anyway.
In fact, as I use Sketch a lot for architectural layout, I was thinking of exporting from FreeCAD and importing to Blender :D

Anyway, hope there are more usecases here to justify the development effort !
hlorus
Posts: 30
Joined: Sun Oct 17, 2021 9:47 am

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by hlorus »

paullee wrote: Sun Oct 17, 2021 4:20 pm In fact, as I use Sketch a lot for architectural layout, I was thinking of exporting from FreeCAD and importing to Blender :D
Ahh good to know...
I assumed the user wouldn't want to tweak an exported sketch in blender as it would already have final dimensions but i guess being able to go back and forth would be helpful.
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

Re: [Sketcher Geometry] - Export/Import between FreeCAD and Blender

Post by paullee »

hlorus wrote: Mon Oct 18, 2021 7:05 pm I assumed the user wouldn't want to tweak an exported sketch in blender as it would already have final dimensions but i guess being able to go back and forth would be helpful.
If things can go back and forth that's ideal, but if thing is as @realhundar point out - ' FreeCAD sketch solver is a dedicated 2D solver ', it seem it may need too much effort to do the export / import.

And BTW, Sketch in FreeCAD could have many other additional features, e.g.

- it could built-in with Python methods, e.g. automatically identify enclose 'room' and build 'CellComplex' as I test elsewhere
- each edge can carry inherent information (as 'I' in BIM), then the edges may be specified as 'Wall Axis' etc.
Post Reply