Search found 1746 matches

Go to advanced search

by sliptonic
Tue May 26, 2020 7:29 pm
Forum: Path/CAM
Topic: Path Code Style Guide
Replies: 27
Views: 983

Re: Path Code Style Guide

UPPERCASE are constants; camel_case for all variable and function names; PascalCase for classes. This are the basics. Initial underscore is for private entitities, _smal_function, _SmallClass. Essentially, Python heavily favors camel_case, except for classes. Even module names should follow this, m...
by sliptonic
Tue May 26, 2020 4:27 pm
Forum: Path/CAM
Topic: Path Code Style Guide
Replies: 27
Views: 983

Re: Path Code Style Guide

Whether you agree or disagree with the narrator's code structure, he does provide some IMHO good concepts about information to be provided, docs etc and yes you can ignore the specifics relating to Blender but I still found it useful https://www.youtube.com/watch?v=_8KsNVE6KJs You successfully dist...
by sliptonic
Tue May 26, 2020 3:55 pm
Forum: Path/CAM
Topic: Let's talk about errors and warnings.
Replies: 19
Views: 673

Re: Let's talk about errors and warnings.

I agree with Chris. Less is sometimes more. The default condition when Path is operating normally should be silence. Developers should use the PathLog module more to put informational messages in so a curious user can see more output if desired. Red in report view should ONLY be used if something un...
by sliptonic
Tue May 26, 2020 2:42 pm
Forum: Path/CAM
Topic: Path Code Style Guide
Replies: 27
Views: 983

Re: Path Code Style Guide

IMPORTS.

Should be alphabetized
should NOT include wildcards ie:

Code: Select all

  from foo import *
For long or relative imports use 'as' to keep subsequent code readable. ie

Code: Select all

import PathScripts.PathGeom as PathGeom
by sliptonic
Tue May 26, 2020 2:37 pm
Forum: Path/CAM
Topic: Path Code Style Guide
Replies: 27
Views: 983

Re: Path Code Style Guide

- Comments COMMENT YOUR CODE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11111111111 External Python functions should include the doc comment? def functionName(): ''' This is a doc comment to provide a description and example to appear in the python console''' This isn't really a comment. It's a docstring....
by sliptonic
Mon May 25, 2020 11:57 pm
Forum: Path/CAM
Topic: Let's talk about errors and warnings.
Replies: 19
Views: 673

Re: Let's talk about errors and warnings.

Chris, in those cases mentioned where it's normal workflow, should the errors just be changed to warnings or should the system remain entirely silent?

I've started a cleanup branch and most of the offending code is my own old stuff. :oops:
by sliptonic
Mon May 25, 2020 3:11 pm
Forum: Path/CAM
Topic: Let's talk about errors and warnings.
Replies: 19
Views: 673

Let's talk about errors and warnings.

I've noticed that there isn't much consistency in how we're using FreeCAD.Console.PrintWarning and FreeCAD.Console.PrintError. The result is a mess of red and orange messages in the report view. In my opinion, the user would ideally never see a red message (error). When red messages appear, the deve...
by sliptonic
Fri May 22, 2020 5:54 pm
Forum: Path/CAM
Topic: Start Depth, Start step down?
Replies: 10
Views: 338

Re: Start Depth, Start step down?

it be cool to be able to configure a custom initial step down depth for first 2 step downs, and final step down depth for a final layer, for all cuts. To do this now, I have to make separate cuts. In multiple parts milling, this becomes pretty convoluted. In PathUtils.py there's a class called dept...
by sliptonic
Fri May 22, 2020 4:09 pm
Forum: Path/CAM
Topic: New Property: Feed Rate Factor [Canceled]
Replies: 29
Views: 1069

Re: New Property: Feed Rate Factor

This property will allow us to adjust the Tool Controller fixed feed rate by a factor for each operation as needed, instead of having to duplicate the Tool Controller for the sake of a different feed rate for the same tool. But this is exactly the reason that tool controllers exist. IMHO operations...
by sliptonic
Wed May 20, 2020 10:06 pm
Forum: Python scripting and macros
Topic: Need some help with the math
Replies: 23
Views: 989

Re: Need some help with the math

And Lenny seems to a bit stubborn, thinking something like "I just turned 180° and now again? No, sir, if he really wanted this he wouldn't have turned the first time!" Actually, You were pretty close on this one too. The b-code produced by the algorithm gives the rotation angle between bends incre...

Go to advanced search