[Behaviour suggestions] New sketch plane selection

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Behaviour suggestions] New sketch plane selection

Post by paddle »

Well most people seem on-board for this one so I'll start here.
For 2- I think I can do it quickly for 1- it might need more thinking.
chrisb
Veteran
Posts: 53943
Joined: Tue Mar 17, 2015 9:14 am

Re: [Behaviour suggestions] New sketch plane selection

Post by chrisb »

paddle wrote: Tue Jan 04, 2022 1:09 pm for 1- it might need more thinking.
It would help already a lot, if you can increase the line thickness of the frame.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [Behaviour suggestions] New sketch plane selection

Post by openBrain »

chrisb wrote: Tue Jan 04, 2022 1:43 pm It would help already a lot, if you can increase the line thickness of the frame.
IIRC, it uses Pick radius for line (pre)selection.
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Behaviour suggestions] New sketch plane selection

Post by paddle »

chrisb wrote: Tue Jan 04, 2022 1:43 pm It would help already a lot, if you can increase the line thickness of the frame.
Yes you're right.
paddle wrote: Tue Jan 04, 2022 1:09 pm For 2- I think I can do it quickly
About that it seems that I don't understand the code so it's not so easy afterall.

I'm in mod/Partdesign/GUI/command.cpp
The code logic for newsketch tool seems to be in the function

Code: Select all

void CmdPartDesignNewSketch::activated(int iMsg)
Yet I'm at a loss. This is the part that seems to defined the behaviour of the OK button :

Code: Select all

// Called by dialog when user hits "OK" and accepter returns true
        auto worker = [=](const std::vector<App::DocumentObject*>& features) {
            // may happen when the user switched to an empty document while the
            // dialog is open
            if (features.empty())
                return;
            App::Plane* plane = static_cast<App::Plane*>(features.front());
            std::string FeatName = getUniqueObjectName("Sketch",pcActiveBody);
            std::string supportString = getObjectCmd(plane,"(",",[''])");

            FCMD_OBJ_CMD(pcActiveBody,"newObject('Sketcher::SketchObject','" << FeatName << "')");
            auto Feat = pcActiveBody->getDocument()->getObject(FeatName.c_str());
            FCMD_OBJ_CMD(Feat,"Support = " << supportString);
            FCMD_OBJ_CMD(Feat,"MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace)<<"'");
            Gui::Command::updateActive(); // Make sure the Support's Placement property is updated
            PartDesignGui::setEdit(Feat,pcActiveBody);
        };
Yet this block is actually in the tool 'activated' function. I don't understand how a dialog can call that specific block of code.
Beside I can't find the code of the dialog.

Is anyone familiar with this and want to make this ?
bleber
Posts: 259
Joined: Thu Jun 30, 2016 5:12 pm

Re: [Behaviour suggestions] New sketch plane selection

Post by bleber »

One hand on mouse the other on keyboard, single click on plane and enter key to accept/ok
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Behaviour suggestions] New sketch plane selection

Post by adrianinsaval »

paddle wrote: Tue Jan 04, 2022 1:09 pm 1- it might need more thinking.
maybe you need to place a translucent (filled) rectangle behind the letters. Making the lines of the planes thicker may be helpful too.
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Behaviour suggestions] New sketch plane selection

Post by paddle »

adrianinsaval wrote: Tue Jan 04, 2022 3:09 pm maybe you need to place a translucent (filled) rectangle behind the letters. Making the lines of the planes thicker may be helpful too.
You're probably right but the question is how to do that :)
I have no clues how the part design workbench works that's the main difficulty.

I'm also in to make plane lines thicker.

Something like this? (just a paint mockup I haven't done it yet :p)
plane drawing.png
plane drawing.png (56.21 KiB) Viewed 2065 times
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Behaviour suggestions] New sketch plane selection

Post by adrianinsaval »

Looks good, this looks like it involves some coin3d wizardry and I think it's not actually defined in Part Design but just inherited from the core (Part containers have them too).
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Behaviour suggestions] New sketch plane selection

Post by paddle »

adrianinsaval wrote: Tue Jan 04, 2022 3:30 pm Looks good, this looks like it involves some coin3d wizardry and I think it's not actually defined in Part Design but just inherited from the core (Part containers have them too).
Any idea who's wizard enough to handle it?
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

Re: [Behaviour suggestions] New sketch plane selection

Post by Pauvres_honteux »

paddle wrote: Tue Jan 04, 2022 5:33 pm Any idea who's wizard enough to handle it?
Maybe mariwan?
mariwan wrote:
Post Reply