noob question

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!
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: noob question

Post by NormandC »

Looking good! :) This is for a NEMA-17 stepper motor right?

As you've noticed, there is no polygon tool in the sketcher ATM. There is one in the Draft module, but the Draft module doesn't work like the sketcher. You cannot link to external geometry (edges).

Still a Draft polygon can be drawn pretty quickly, and it's compatible with Part Design features. If you don't mind having to place it through its coordinates, and to edit them manually again whenever you make other changes in your model, it's the fastest way.

Click on the face you want to draw the polygon on, switch to the Draft workbench then start the polygon tool. The working plane will be automatically set to the face, which links/maps the polygon to the face. Draw the polygon, then change its coordinates, go back to Part Design, and click on the pocket tool.

To facilitate the placement of the hexagon, you could first create a sketch on the face of your part with some guiding geometry, like lines or a rectangle. You can add reference geometry (by copying edges) and add dimension constraints to it. But your guiding geometry should not be construction line or they will be hidden once you quit the sketch edit mode.

Then you start the polygon tool, and snap on an end point or midpoint of your sketch guide geometry. The drawback to this is if you change the size of your part, the sketch will update but the polygon won't, it will keep its coordinates.

Or if you want to keep working in the Part Design workbench, you will have to draw the polygon the "hard way". The trick with constraining a polygon is to inscribe it in a construction circle (see attached example). To place the polygon in reference to your face you add distance constraints to the circle's center point.

Did you know that you can copy-paste sketches between FreeCAD documents? I suggest you draw and constrain your hexagon in an empty document and save it so you can reuse it as a template. Copy the sketch, and paste it in the document where your part resides. Next you need to map the sketch to a face, or you will get an error that you need a sketch supported by a solid.

Mapping an unlinked sketch to a part's face
This is useful for sketches pasted from other documents but also for sketches that have somehow lost their link to their support face, or if you want to change the support face for your sketch. In those last two cases, it is recommended to edit them first to delete reference (magenta) geometry, as once the sketch is remapped to a new face, the existing reference geometry will not be recognized and this will mess up the sketch. To the point that if you attempt to edit it, it may occasionally crash FreeCAD.
  1. Select the face of your part you want the sketch to be mapped to
  2. Click on the Image "Map sketch to face" icon in the Sketcher toolbar
  3. A small dialog pops up. In the drop down list, select the sketch to be mapped and click OK.
  4. The sketch opens in Edit mode. Add required constraints to fully constrain the sketch.
Attachments
Hexagon.fcstd
(7.99 KiB) Downloaded 73 times
buick455
Posts: 14
Joined: Sun Mar 10, 2013 8:55 pm

Re: noob question

Post by buick455 »

normandc wrote: Looking good! :) This is for a NEMA-17 stepper motor right?
Yup, when I built my Prusa I had problems with the Z lead-screws, so I bought new screws and those Alu Flex Couplers. Well the flex was too flexi and I bought 2 thrust bearings and then made motor lifter plates for the Z motors and since I did it the machine prints allllot better. This model I have been using to learn with is just another adaptation of that lift but for a completely new machine (you will see if I ever get that far).
normandc wrote: As you've noticed, there is no polygon tool in the sketcher ATM. There is one in the Draft module, but the Draft module doesn't work like the sketcher. You cannot link to external geometry (edges).
It will be great when they get that in the sketcher, maybe ovals too..
normandc wrote: Or if you want to keep working in the Part Design workbench, you will have to draw the polygon the "hard way". The trick with constraining a polygon is to inscribe it in a construction circle (see attached example). To place the polygon in reference to your face you add distance constraints to the circle's center point.

Did you know that you can copy-paste sketches between FreeCAD documents? I suggest you draw and constrain your hexagon in an empty document and save it so you can reuse it as a template. Copy the sketch, and paste it in the document where your part resides. Next you need to map the sketch to a face, or you will get an error that you need a sketch supported by a solid.
I went with this method. I didn't know I could pull sketches from other files, it made it alot easier. I created a new doc, then I created 2 sketches that are "re-sizable" one with the hexagon at 0-deg and one at 90-deg. I paste, map to face, external geo the hole, then constrain the mapped sketch and its done. I will be honest if I had to draw that damn hexagon every time I needed one I would have to wait till the tool gets added, it would get old quick..
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: noob question

Post by jmaustpc »

A tip that may help sometimes, under some circumstances.
You can create Draft objects then click on the Draft to Sketcher tool and put that item into a sketch. This does work for Draft Polygon. The polygon will not be constrained.

Jim
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: noob question

Post by yorik »

jmaustpc wrote:The polygon will not be constrained.
I could change that, actually... Maybe constrain the angles?
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: noob question

Post by NormandC »

I work daily with a commercial CAD software that does not have polygons! Well it was finally added to its sketcher a couple versions ago, but we're still working with a 6-year old version so no polygon for me. So I'm used to draw them as I've done in the file attached.

To constrain an hexagon, you don't need to add angle constraints. But you need to add a construction circle, otherwise how are you going to position the hexagon by its center?

So you either inscribe or circumscribe the circle to the hexagon. I prefer the second method, so I add point on object constraints from the polygon's vertices to the circle. Obviously equality constraints between all edges. Two vertical or horizontal constraints (depending on your hexagon orientation) are then applied, and all that is left to do is to add the hexagon width and finally a lock constraint to the circle's center point.

IMO if you don't convert a Draft Polygon to what I just said, it will not be of much use. And I'm guessing that would be quite a lot of code.

Since you can make a Sketch of a polygon and reuse it afterward honestly I don't see this as a problem... Hell I just provided one, so people who find it a hassle won't even have to make it themselves. ;)
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: noob question

Post by jmaustpc »

yorikvanhavre wrote:
jmaustpc wrote:The polygon will not be constrained.
I could change that, actually... Maybe constrain the angles?
How about "across flats" as well? Most nuts...metric and UNF/UNF (not Whitworth) ...are measured AF. :)

Edit: - Norm's replied before I saw that he had.

But still I think it would be good "polish" to have a Polygon tool, in sketcher.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: noob question

Post by NormandC »

jmaustpc wrote:But still I think it would be good "polish" to have a Polygon tool, in sketcher.
Of course.

Actually there should be a Mantis request for this.
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: noob question

Post by keithsloan52 »

Another way to create a polygon sketch is to.

1) Goto OpenSCAD workbench
2) Click on the Add OpenSCAD element icon
3) Change the input from cube(); to circle(10,$fn=6);
Where 10 is the radius and $fn is the number of sides.
4) Click add
5) Goto Draft workbench & convert to sketch.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: noob question

Post by NormandC »

As I said, this does not create a fully constrained sketch, with an inscribed or circumscribed construction circle helping in placing the polygon.

I see absolutely no benefit compared to drawing it from scratch in the Sketcher in the first place.

This comes from a few years of working with constraint-based sketching.
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: noob question

Post by keithsloan52 »

As I said, this does not create a fully constrained sketch, with an inscribed or circumscribed construction circle helping in placing the polygon.

I see absolutely no benefit compared to drawing it from scratch in the Sketcher in the first place.
Is it not easier to add the constraint & construction lines after creating the polygon, rather than having to draw
the polygon in sketcher
Post Reply