toSketch Workbench

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
keithsloan52
Posts: 1576
Joined: Mon Feb 27, 2012 5:31 pm

toSketch Workbench

Postby keithsloan52 » Wed Jan 13, 2021 2:38 pm

Aimed at re-engineering existing models i.e imported STEP and OpenSCAD models.

toSketch Workbench ( Renamed from Face2Sketch ) https://github.com/KeithSloan/toSketch

Provides the following facilities
  • Face to Sketch : Select a planar face and then creates a new sketch
  • Section Plane to Sketch : Select a Plane which will then be used to section Objects and create a new sketch
Interested in feedback and any other suggestions to help with re-engineering models coming from external sources.

Just waiting for icon from @jmaustin
abdullah
Posts: 3880
Joined: Sun May 04, 2014 3:16 pm

Re: toSketch Workbench

Postby abdullah » Sat Jan 16, 2021 6:31 pm

keithsloan52 wrote:
Wed Jan 13, 2021 2:38 pm
Aimed at re-engineering existing models i.e imported STEP and OpenSCAD models.

toSketch Workbench ( Renamed from Face2Sketch ) https://github.com/KeithSloan/toSketch

Provides the following facilities
  • Face to Sketch : Select a planar face and then creates a new sketch
  • Section Plane to Sketch : Select a Plane which will then be used to section Objects and create a new sketch
Interested in feedback and any other suggestions to help with re-engineering models coming from external sources.

Just waiting for icon from @jmaustin
I took a look at the Python code. I see you use the draft WB conversion routines with autoconstraints set on.

I do not know well those routines. What I wanted to say is that the Sketcher has some autoconstraining functionality that might be useful after applying the draft to sketcher conversion. Maybe it is useless to your use case. Just in case.

This is are the Python functions (not only the autoconstraint one, but then there are others to detect missing horizontal, vertical,)
https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L1497

The actual c++ functions are here (in case you want to take a look to the insides):
https://github.com/FreeCAD/FreeCAD/blob ... s.cpp#L143

And probably the best addition to all them. Somebody that knows how to use them:
easyw-fc wrote: ...ping...
The ping is just to make you aware of this thread, in case Keith has questions about how you use these from Python ;) I can look into the c++ code, but I no longer remember by heart of what they offer...
kisolre
Posts: 2998
Joined: Wed Nov 21, 2018 1:13 pm

Re: toSketch Workbench

Postby kisolre » Sat Jan 16, 2021 7:00 pm

keithsloan52 wrote:
Wed Jan 13, 2021 2:38 pm
Interested in feedback
In the Readme you should mention (for now) that it can also be installed from the Addon manager when added as Custom repository.
kisolre
Posts: 2998
Joined: Wed Nov 21, 2018 1:13 pm

Re: toSketch Workbench

Postby kisolre » Sat Jan 16, 2021 7:05 pm

Why does switching to the workbench makes all objects visible?
Edit: Also all body origins are made visible?!?
keithsloan52
Posts: 1576
Joined: Mon Feb 27, 2012 5:31 pm

Re: toSketch Workbench

Postby keithsloan52 » Sat Jan 16, 2021 8:25 pm

kisolre wrote:
Sat Jan 16, 2021 7:05 pm
Why does switching to the workbench makes all objects visible?
Edit: Also all body origins are made visible?!?
Because when I make a Sketch from a Face, I am hiding the Object of the selected Face and when exiting the Sketch editor making everything visible. i.e. a quick fix/hack

Do people work on Sketches with other Objects visible or not?
keithsloan52
Posts: 1576
Joined: Mon Feb 27, 2012 5:31 pm

Re: toSketch Workbench

Postby keithsloan52 » Sat Jan 16, 2021 8:26 pm

kisolre wrote:
Sat Jan 16, 2021 7:00 pm
keithsloan52 wrote:
Wed Jan 13, 2021 2:38 pm
Interested in feedback
In the Readme you should mention (for now) that it can also be installed from the Addon manager when added as Custom repository.
Thanks - Was not aware of Custom repository option.
kisolre
Posts: 2998
Joined: Wed Nov 21, 2018 1:13 pm

Re: toSketch Workbench

Postby kisolre » Sat Jan 16, 2021 8:45 pm

keithsloan52 wrote:
Sat Jan 16, 2021 8:25 pm
Because when I make a Sketch from a Face,
It happens BEFORE any sketch creation. So if I have an object and want to create something around it ALL other objects are made visible which could obscure the object from which a sketch needs to be created. And having all body (and I assume also Part) origins visible makes a big mess on the screen.
keithsloan52
Posts: 1576
Joined: Mon Feb 27, 2012 5:31 pm

Re: toSketch Workbench

Postby keithsloan52 » Sat Jan 16, 2021 8:56 pm

kisolre wrote:
Sat Jan 16, 2021 8:45 pm
keithsloan52 wrote:
Sat Jan 16, 2021 8:25 pm
Because when I make a Sketch from a Face,
It happens BEFORE any sketch creation. So if I have an object and want to create something around it ALL other objects are made visible which could obscure the object from which a sketch needs to be created. And having all body (and I assume also Part) origins visible makes a big mess on the screen.
Yes it happens any time the Workbench is activated, will try and come up with a better solution, thanks for the feedback.
keithsloan52
Posts: 1576
Joined: Mon Feb 27, 2012 5:31 pm

Re: toSketch Workbench

Postby keithsloan52 » Sat Jan 16, 2021 9:16 pm

kisolre wrote:
Sat Jan 16, 2021 8:45 pm
keithsloan52 wrote:
Sat Jan 16, 2021 8:25 pm
Because when I make a Sketch from a Face,
It happens BEFORE any sketch creation. So if I have an object and want to create something around it ALL other objects are made visible which could obscure the object from which a sketch needs to be created. And having all body (and I assume also Part) origins visible makes a big mess on the screen.
I have commented out the code making of all objects visible on workbench activation until I come up with a better solution.
If you perform a git pull from the workbench directory you should get the new code.

Same question as before, when working on a sketch do you have all objects hidden?
kisolre
Posts: 2998
Joined: Wed Nov 21, 2018 1:13 pm

Re: toSketch Workbench

Postby kisolre » Sat Jan 16, 2021 9:29 pm

keithsloan52 wrote:
Sat Jan 16, 2021 9:16 pm
If you perform a git pull from the workbench directory you should get the new code.
Since I installed it through Addon manager it also shows that there is an update :)
keithsloan52 wrote:
Sat Jan 16, 2021 9:16 pm
Same question as before, when working on a sketch do you have all objects hidden?
I have the default (I think) visibility automation (all options ticked). Then if I need something visible while editing the sketch I show/hide it. But this usually only hides the sketch body, not everything else.