[Solved] how to get an orthogonal line

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Solved] how to get an orthogonal line

Post by onekk »

Sorry for the lack of helpers methods, to create new file.

I use scripting directly loading py files onto FreeCAD.

Usually I use the convention to

Code: Select all

DOC = FreeCAD.ActiveDocument()
And I have some helpers methods to ensure that there is at least one document open.

@edwilliams16

When I've studied your text could I send you a PM if I have some doubts, or maybe I could offer to make a pdf to put somewhere to made a the "for dummies" text available to beginners.

@BryantL thanks for advice, I will see if it speeds ups things.

Regards

Carlo D
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
edwilliams16
Veteran
Posts: 3191
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: [Solved] how to get an orthogonal line

Post by edwilliams16 »

PM is fine if it isn’t of general interest. I proposed the primer for the wiki. I uploaded an extended version there.

Now available for comment at https://github.com/edwilliams16/FreeCAD ... FreeCAD.md
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Solved] how to get an orthogonal line

Post by onekk »

@BryantL, I've tried your method, but it will not permit something, (or even I could not achieve my goal), the image could not be moved and zoomed in, showing only the portion of interest.

However, I've found that GIMP will have a very good mesuring tool, and this tool could be very useful.
A better approach could be a way to superimpose two images, one the original sheet and a grid spaced to pinpoint relevant points (sorry for the word joke).

Many thanks for the advice.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
BryanL
Posts: 17
Joined: Mon Feb 15, 2021 5:56 am

Re: [Solved] how to get an orthogonal line

Post by BryanL »

Can we see a pic of what you are trying to copy?
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Solved] how to get an orthogonal line

Post by onekk »

Sorry is a reserved work, but is simply a technical drawing done by hand.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
edwilliams16
Veteran
Posts: 3191
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: [Solved] how to get an orthogonal line

Post by edwilliams16 »

Tracing the sketch with the image workbench didn't work for you? Do you have an old version of FreeCAD?
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Solved] how to get an orthogonal line

Post by onekk »

Yes and no. I could load the image, but it gave me only the 1:1 and fit to window so I can't zoom in and move the viewpoint or I can't guess how to do this thing or it is not possible.

Plus sketching is not a viable solution as I'm doing scripting to trasform these drawing in model to be 3d printed so I've to parametrize things, and I need (point list) and coordinates to make some other things like modeling the assembly to put pieces together.

With scripting you a have some thing "written down" with measure and text file that is small and compact, plus with some helpers method you pass only a tuple with coordinates to Part.makePolygon() and it is a three lines thing to model complex shapes (not counting the point list) if you have set a wrong figure, change the wrong figure say (0, 4.543, 0) and you rebuild the whole model in 20 seconds, with the GUI is a nightmare to trace all the related measure and act accordingly.

Suppose you cut out the model from a pieces of plywood that is 12 mm thick and what to use 15mm if you build the model with

Code: Select all

thi = 12
It's a matter to change only the figure 12 to 15 and relaunch the script.

Hope I have done a clear explication.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
edwilliams16
Veteran
Posts: 3191
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: [Solved] how to get an orthogonal line

Post by edwilliams16 »

There’s three buttons on the workbench. The last one is a scale tool. You select two points on the image a known distance apart and type in the distance. You can then zoom and stay scaled. The file I provided earlier used the line segment as the scale.
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Solved] how to get an orthogonal line

Post by onekk »

Thanks I will try, it may be useful.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply