Merge Sketches is distorting the sketches

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53786
Joined: Tue Mar 17, 2015 9:14 am

Re: Merge Sketches is distorting the sketches

Post by chrisb »

ChrisFC wrote: Mon Dec 06, 2021 5:46 pm Said CAD exists in 3D toroidal space,
About wording: Here we use the notion "CAD" rather for this kind of program, and we talk about a "model" for what we create with the program.

To me it seems you should start from the other end: Create one or more master sketches, possibly attached appropriately, where you make your changes, and reference these master sketches from your slanted ones.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
ChrisFC
Posts: 27
Joined: Mon Jul 26, 2021 8:30 am

Re: Merge Sketches is distorting the sketches

Post by ChrisFC »

Hi all and thank you for the replies. I have managed to strip down my model and make it ambiguous enough that I've gotten the green-light to be able to upload it here so that others can get a better idea of what it is that I am trying to do. I suspect I am perhaps misunderstanding how to approach things in FreeCAD, and that others with more experience will spot what to do quite quickly. The file is attached, and I will now explain what I am trying to do
FREECAD_FORUMS_CHRISFC_HELP.FCStd
(9.05 KiB) Downloaded 22 times
In said file there are 3 things. The first is a central cross section of the model in the form of a sketch. If you edit the sketch, I have set up constraints such that I can essentially make the object thicker (default length set to 10mm for illustration), as iterating through variations in this central thickness if a part of the project, and so it made sense to make this into an easily changeable quantity via the sketch. There are the 2 end faces of what will become the finished object. My work involves shaping the top surface of this presently empty model (it looks like the end points are simply a rotated version of the central cross section, however, they are not, and this is intended). In order to performing this shaping work, I essentially want to draw a circular arc through the corner points A, B, C as illustrated below. I want A and C (along with the end faces themselves) to remain completely fixed and unmovable. I want B to always be the corner point shown. As you can see, the point B should be able to move up/down as I make the central cross-section thicker/thinner, with the circular arc ABC changing its radius of curvature to follow the new point B. Any help would be appreciated, as would (if at all possible) a modified file, so that I can learn for myself how to better approach this task. In the past, I tried defining the points as draft points, and whilst I was able to make the circular arc, the point B did not follow the central cross section as its thickness was changed. Any help would be appreciated!
freecad_help_1.png
freecad_help_1.png (12.3 KiB) Viewed 1164 times
Cheers all,
Chris

@chrisb @domand @TheMarkster
domad
Veteran
Posts: 2029
Joined: Mon Jun 22, 2020 12:16 pm

Re: Merge Sketches is distorting the sketches

Post by domad »

ChrisFC wrote: Tue Dec 07, 2021 2:13 pm .....
Hi ChrisFC, greetings to the Community!
Is this what you want to achieve?
If your answer is "yes" then I advise you to transform the two lateral ones into Sketch (making them completely alleyways), create a Body in Part Design, then transfer the 3 Sketchs inside the Body and finally proceed to the "Loft" function by Part Design ".
Attachments
FREECAD_FORUMS_CHRISFC_HELP-2.FCStd
(15.4 KiB) Downloaded 20 times
freecad_help_1.gif
freecad_help_1.gif (286 KiB) Viewed 1132 times
ChrisFC
Posts: 27
Joined: Mon Jul 26, 2021 8:30 am

Re: Merge Sketches is distorting the sketches

Post by ChrisFC »

domad wrote: Tue Dec 07, 2021 3:54 pm
ChrisFC wrote: Tue Dec 07, 2021 2:13 pm .....
Hi ChrisFC, greetings to the Community!
Is this what you want to achieve?
If your answer is "yes" then I advise you to transform the two lateral ones into Sketch (making them completely alleyways), create a Body in Part Design, then transfer the 3 Sketchs inside the Body and finally proceed to the "Loft" function by Part Design ".
Hi domad!

Firstly thank you for taking the time to help with this. This is close to, but not exactly what I am after. See, in reality, I have a large block that overlaps the model that you show. By connecting a circular arc on either of those leading edges as I described, I had planned to make a conical surface between those 2 circles. What you have created with the loft is very close to this, however, my plan is for said conical surface to be extended beyond the periphery of the present model you show, such that I can us it to cut away at the aforementioned larger block. Ultimately these end faces that I provided are guides in helping the creating of the circles bounding said conical surface. The top surface you have produced would in reality be only a part of said conical surface
Screenshot from 2021-12-07 18-58-24.png
Screenshot from 2021-12-07 18-58-24.png (21.89 KiB) Viewed 1092 times
Here is a picture to illustrate. My ultimate goal is to use said circle through those end corner points to define an extended conical surface that would shape the black block as shown; those end faces provided are the necessary geometric guide to creating said circles. In actuality, I would like to also create another thickness parameter on the opposite side of the central cross section also, such that the radius of curvature of the inner and outer circles would be different, in turn changing to angle of the conical surface bounding the 2 surves.

Sorry if I hadn't explained the problem well at the start. What you have shown so far has been extremely useful. I had some questions following up on what you have shown if that's ok?

1. Would a sweep not be more appropriate than a loft here, or are they acting in the same way? and if so, is the loft/sweep rotating about the Z axis or some other axis?
2. Whenever I click on the Convert between draft and sketch objects button in the Draft workbench, in order to change those end faces into sketches, I keep getting the error:

Code: Select all

18:53:17  Traceback (most recent call last):
  File "/tmp/.mount_FreeCAfOwzqY/usr/Mod/Draft/draftutils/todo.py", line 167, in doTasks
    Gui.doCommand(string)
  File "<string>", line 1, in <module>
  File "/tmp/.mount_FreeCAfOwzqY/usr/Mod/Draft/draftmake/make_sketch.py", line 304, in make_sketch
    nobj.addGeometry(DraftGeomUtils.orientEdge(
TypeError: Unsupported geometry type: Part::GeomHyperbola
preventing me from doing so.

3. What is a 'complete alleyway'?
4. Is it possible to define a circular arc by 3 points in a sketch, wherein 1 point is in said sketch, and the other 2 (end) points are in an external geometry? I'm just thinking if there is a way to not have to make the end points sketches, but to still use the relevant corner points in them to produce said circles.

Cheers and many thanks,
Chris
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Merge Sketches is distorting the sketches

Post by TheMarkster »

I put together a macro to do this. It's still raw around the edges, no icon, not much error checking, but seems usable in this test case. Obviously hasn't been tested much.

Put both files in your macros folder. Run the .FCMacro only. The other is used to make the ParametricArc object's still functional after reloading a document containing one of them. The py file should not be run directly.

Usage: select 3 vertices and run the macro. The "Order" property may be used to reset the order if the arc produced isn't as expected.
Snip macro screenshot-f5a9e9.png
Snip macro screenshot-f5a9e9.png (46.59 KiB) Viewed 1071 times
Snip macro screenshot-98987c.png
Snip macro screenshot-98987c.png (45.08 KiB) Viewed 1071 times
Snip macro screenshot-7317c4.png
Snip macro screenshot-7317c4.png (60.52 KiB) Viewed 1071 times
Attachments
parametricarc.py
(4.16 KiB) Downloaded 27 times
ParametricArc.FCMacro
(1.45 KiB) Downloaded 24 times
ChrisFC
Posts: 27
Joined: Mon Jul 26, 2021 8:30 am

Re: Merge Sketches is distorting the sketches

Post by ChrisFC »

TheMarkster wrote: Tue Dec 07, 2021 7:53 pm I put together a macro to do this. It's still raw around the edges, no icon, not much error checking, but seems usable in this test case. Obviously hasn't been tested much.

Put both files in your macros folder. Run the .FCMacro only. The other is used to make the ParametricArc object's still functional after reloading a document containing one of them. The py file should not be run directly.

Usage: select 3 vertices and run the macro. The "Order" property may be used to reset the order if the arc produced isn't as expected.

Snip macro screenshot-f5a9e9.png

Snip macro screenshot-98987c.png

Snip macro screenshot-7317c4.png
Hi Markster,

Many thanks for taking the time to look into this! I will certainly try this out and let you know how it goes. Before this I have 1 question. This conical surface that has been created, is there any way to extend it outward/inward, such that whilst the surface is guided by the two arcs, it does not contrain the edge of the surface?

Cheers,
Chris
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Merge Sketches is distorting the sketches

Post by TheMarkster »

New version: 0.2021.12.7.rev2

New properties:

Value1, Value2 -- allows to extend arc beyond vertex1 and vertex3. (Very buggy. Does not always produce expected results.)
Radius Offset -- allows to adjust the radius of the arc (moves it off the vertices)
Show Center -- show the center as a vertex in the 3D view.
Center -- coordinates of the center
Reverse -- swaps vertex1 and vertex3
Complement -- shows the complementary arc

All of this still largely untested. Only parametricarc.py has been changed.
Attachments
parametricarc.py
(5.74 KiB) Downloaded 17 times
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Merge Sketches is distorting the sketches

Post by TheMarkster »

If you want to try out the macro, you need both files. The .FCMacro file by itself will not work.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Merge Sketches is distorting the sketches

Post by TheMarkster »

New version: 0.2021.12.7.rev3

I think I have the bug fixed where the Value1 and Value2 properties were not working as expected. A - value for Value1 should move the arc before the first point, but along the arc of the circle and a + value for Value2 should move the arc beyond the last point. Value1 and Value2 are floating point values representing the angle in radians (I think.), so 2 * pi = 6.28... will be a full circle.
Attachments
parametricarc.py
(5.85 KiB) Downloaded 17 times
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Merge Sketches is distorting the sketches

Post by TheMarkster »

One more update, can't resist adding more features, it seems.

New version: 0.2021.12.7.rev4

New properties:

Vertex1Offset, Vertex2Offset, Vertex3Offset -- allow to independently adjust the position of the vertices.
Mirror -- mirror the arc and show both the original and the mirror (mirrored about the center)
MirrorOnly -- show only the mirror, not the original
Attachments
parametricarc.py
(6.85 KiB) Downloaded 20 times
Post Reply