PartDesign Hole feature

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PartDesign Hole feature

Postby NormandC » Fri Mar 24, 2017 2:30 am

eivindkvedalen wrote:I'm rebasing regularily on my computer, so it's still in good shape
Awesome. :)
wmayer
Site Admin
Posts: 15000
Joined: Thu Feb 19, 2009 10:32 am

Re: PartDesign Hole feature

Postby wmayer » Wed Apr 12, 2017 11:06 am

Since there are further requests to finally add this to master I gave it a try yesterday evening. However, due to the latest changes some things have been broken and in the that stage it doesn't work any more. So, I found and fixed a couple of issues but it still has some problems.

I have pushed the rebased and fixed branch to my github repo: https://github.com/wwmayer/FreeCAD/commits/hole
  • The FeatureHole replaced Length with Depth but in the command still Length was used
  • When canceling the command abortCommand() is invoked to revert all pending changes of the document. Therefore the member variable vp is set to nullptr which wasn't handled.
  • The boost connection wasn't disconnected in the destructor which then caused crashes when using the command more than once
  • pass double values instead of quantities to doCommand
At the moment things basically work again but there is a nasty issue I wasn't able to figure out: when double-clicking the hole feature after creation it correctly shows the values. But when pressing OK then diameter and hole cut type always changes their values.

Nevertheless, I think it's again in a state that it can be merged to master now. This way we also get a wider audience that may report more bugs.
eivindkvedalen
Posts: 598
Joined: Tue Jan 29, 2013 10:35 pm

Re: PartDesign Hole feature

Postby eivindkvedalen » Wed Apr 12, 2017 2:53 pm

wmayer wrote:Since there are further requests to finally add this to master I gave it a try yesterday evening. However, due to the latest changes some things have been broken and in the that stage it doesn't work any more. So, I found and fixed a couple of issues but it still has some problems.

I have pushed the rebased and fixed branch to my github repo: https://github.com/wwmayer/FreeCAD/commits/hole
  • The FeatureHole replaced Length with Depth but in the command still Length was used
  • When canceling the command abortCommand() is invoked to revert all pending changes of the document. Therefore the member variable vp is set to nullptr which wasn't handled.
  • The boost connection wasn't disconnected in the destructor which then caused crashes when using the command more than once
  • pass double values instead of quantities to doCommand
At the moment things basically work again but there is a nasty issue I wasn't able to figure out: when double-clicking the hole feature after creation it correctly shows the values. But when pressing OK then diameter and hole cut type always changes their values.

Nevertheless, I think it's again in a state that it can be merged to master now. This way we also get a wider audience that may report more bugs.
Thank you for working on this. I've also done lots of changes locally, and I'll try to incorporate your changes when necessary. Please don't merge the current version, I'd like to get some more functionality in first... I'll push my changes to github during the next days, so more people can test.

Eivind
wmayer
Site Admin
Posts: 15000
Joined: Thu Feb 19, 2009 10:32 am

Re: PartDesign Hole feature

Postby wmayer » Wed Apr 12, 2017 2:59 pm

Thank you for working on this. I've also done lots of changes locally, and I'll try to incorporate your changes when necessary. Please don't merge the current version, I'd like to get some more functionality in first... I'll push my changes to github during the next days, so more people can test.
OK. Please note that since posting on this thread I pushed a few more changes to fix a build error with older OCC versions and a couple of warnings.
chrisb
Posts: 19722
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign Hole feature

Postby chrisb » Mon Jul 03, 2017 5:53 pm

eivindkvedalen wrote:
Wed Apr 12, 2017 2:53 pm
Thank you for working on this. I've also done lots of changes locally, and I'll try to incorporate your changes when necessary. Please don't merge the current version, I'd like to get some more functionality in first... I'll push my changes to github during the next days, so more people can test.
Eivind
May I gently ask for the state of the hole feature? We talked about it and could fairly well use it in the Path Workbench.
HoWil
Posts: 842
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: PartDesign Hole feature

Postby HoWil » Wed Jul 05, 2017 3:59 pm

chrisb wrote:
Mon Jul 03, 2017 5:53 pm
May I gently ask for the state of the hole feature? We talked about it and could fairly well use it in the Path Workbench.
+1... very interested.
BR Howil
eivindkvedalen
Posts: 598
Joined: Tue Jan 29, 2013 10:35 pm

Re: PartDesign Hole feature

Postby eivindkvedalen » Wed Jul 05, 2017 8:20 pm

chrisb wrote:
Mon Jul 03, 2017 5:53 pm
May I gently ask for the state of the hole feature? We talked about it and could fairly well use it in the Path Workbench.
I've had too much other work lately to finish this. I also wanted to add actual threads to it (I've got a 3D printer at work), and that has been more difficult than I anticipated. Additionally, I have had trouble running FreeCAD in a debugger here (Ubuntu 17), as it takes ages to both start and step through code. That makes development very tedious and time consuming. Now it is almost vacation time, so I might get some more time. I might also end up with splitting this into two phases, with real threads postponed.

Eivind
chrisb
Posts: 19722
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign Hole feature

Postby chrisb » Wed Jul 05, 2017 9:54 pm

Looking forward for it. It's done when it's done.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PartDesign Hole feature

Postby NormandC » Thu Jul 06, 2017 2:13 am

eivindkvedalen wrote:
Wed Jul 05, 2017 8:20 pm
I might also end up with splitting this into two phases, with real threads postponed.
That would be a reasonable course of action IMHO. :)

Have a nice vacation!
peterl94
Posts: 999
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: PartDesign Hole feature

Postby peterl94 » Thu Jul 06, 2017 2:35 am

eivindkvedalen wrote:
Wed Jul 05, 2017 8:20 pm
I might also end up with splitting this into two phases, with real threads postponed
Seems like the use cases for modeled threads are fairly limited anyway. In the CAD software I'm familiar with, modeled threads (internal and external) are created with a separate thread feature.