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!
keithsloan52
Veteran
Posts: 2753
Joined: Mon Feb 27, 2012 5:31 pm

Re: noob question

Post by keithsloan52 »

ey Keith, the file is in 4th post.
Okay yes there is a bug, if you edit the scad file and change all center=true to center=false it seems to look okay in OpenSCAD
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: noob question

Post by NormandC »

Hello,
buick455 wrote:Still have the Regal to this day, just wish it aged as well as I have, lmao..
Heh! :)
buick455 wrote:BTW I'm 6of1 over on the RR boards.
RR = RepRap?

Just got one myself not long ago (an AO-100 from Lulzbot, which is a MendelMax 1.0/1.5 clone with the build volume of a Prusa)
buick455 wrote:& my attempt in FreeCad so you can see my progress
The problem with your model is that you have made 4 separate, non-connected pads. They are actually 4 separate parts. But this is not what you want: you want a single cube-like object. The way you did, you'll need to do a boolean fuse to join them together.

This is not necessary in Part Design. First, think of the Part Design workflow as if you were machining a solid block with a milling machine. You start with something big then cut away stuff. Of course sometimes it's better to add material, it all depends on the shape. But for prismatic parts, you should not need to use boolean operations, because the features deal with them for you.

Second thing to know: once you have your starting feature (usually a Pad, but can be a revolution too), to keep working on this solid, you need to map your sketch to one of its faces. Mapping a sketch to a face is the process of linking this sketch to the face of a solid. It is easily done: just click on the face on which you want your sketch to reside, *before* creating the sketch. Otherwise, you will get the Plane selection dialog, which means your sketch will not be linked, and you'll be starting a whole new part.

Mapping a sketch to a solid's face also allows you to use external geometry (edges of the solid) as reference.
buick455 wrote:Getting things constrained is for the lack of better terms a pain in the butt
Well the more complex your profile, the more constraints you need to apply - so yes, it can be tedious. Which is why I'm a big proponent of Breaking the Modeling Down into Small Chunks™. (I didn't trademarked it, though I should! :ugeek: ) In my experience it's often faster to create many simpler sketches and features than a single complex one with a single feature.

Another tip: use geometric constraints as much as possible.

And finally, do not draw in a sketch what you can add as a feature later. I'm thinking about fillets, chamfer, and transformation tools (pattern, mirror). Those are very useful for holes and repeatable patterns.

Replicating your example, here's how I did it:

My first sketch is a single rectangle, centered on the origin (0,0).
Image
The rectangle is centered on the origin point with the symmetric constraint. I selected the top left point, then the bottom right point, then the origin point before applying the symmetryt constraint.

Next I pad it to 47mm, then I select the front face:
Image

Then I click on "Create new sketch". This maps the sketch to the face of the "Pad" feature. Now I draw the cutout:
Image
Here I used the Image External geometry tool to copy the vertical edges of the face. This creates magenta-colored lines which are non-editable. I draw a rectangle, and apply dimensions referencing the magenta lines' endpoints. This will ensure that even if I change the first sketch's dimensions, the cutout will always have specific widths from the side and top edges of the box.

I close the sketch, then I click on the Image Pocket tool, and I extrude it by 50mm. Here's the one weakness of this method: This is one parameter which I cannot relate to the outer box depth. If I change it, I'll have to manually edit the Pocket depth.

Looking at the Project tree, I now have two features: Pad, then Pocket:
Image
Pad was automatically hidden once Pocket was created, because Pocket is the "child" of Pad. Both are representations of the same object. When working on a part in Part Design, the tree is a history of creation of the part, showing the sequence in chronological order. Pocket is now the current state of the part, and we should continue work on this feature, not on Pad. Pad should stay hidden and not be worked on, unless we want to edit it or its sketch.

Next I make the top cutout: I click on the top face of "Pocket", then I create a sketch in a similar method as previously:
Image
I close the sketch, then I create a new Pocket 5mm deep. This creates a new "Pocket001" feature and hides "Pocket".

Next I select the bottom face of Pocket001 and create a new sketch to pocket the centered hole. The current feature is now Pocket002.
Image

I select the bottom face of Pocket002, and create a new sketch. I'm now planning to cutout the four 1.5mm radius holes, but I only draw one circle in my sketch!
Image
I drew it in the top left quadrant but I could have chosen any of the 4 locations. Again I close the sketch, then I pocket it - this time, through all. That's right, I want it to punch through the top recess. More on that later.

The latest feature is now Pocket003.

Here's the fun part: patterning the hole I just pocketed. Since I made sure the rectangle in the first sketch was centered on the global origin, I can use the Image Polar Pattern feature. I select the Pocket003 feature, and click on the PolarPattern icon. I leave Angle at 360 degrees, and set Occurences to 4. The preview should look like this:
Image
That's a lot faster than drawing and constraining all 4 circles in the sketch isn't it!

After clicking OK a new "PolarPattern" has been created in the tree which now looks like this:
Image

Next, I select the top face of the recess and create a sketch to pocket the large hole. The process is the same as for the bottom centered hole. I end up with "Pocket004":
Image

Now I select the recessed face of "Pocket004" and create a new sketch for the angled rectangular slot. The reason for punching the small hole through is revealed:
Image
I'm using the external geometry tool again, this time to copy the edge of the small hole. (It does not copy the whole circle, but rather an arc. This is one of FreeCAD's quirks.) I can then add tangent constraints from the linked arc edge to the long edges of the rectangle. I set a 135 degree angled constraint from an edge of the rectangle to the horizontal (red) axis. And to center the length of the slot to the hole, I draw a small line from the center point of the copied arc edge. I do not attach the other end to the rectangle side yet, and click on empty space. I apply a symmetric constraint between the two endpoints of the rectangle's long edge, and the small line endpoint. This automatically centers the end of the short line to the rectangle's edge. Then I turn the short line to a construction line, and I add a perpendicular constraint between both lines. Here, only one dimension constraint was necessary, for the length of the rectangle - its width is determined by the hole diameter.

Almost finished. I make sure Sketch006 is selected and pocket it, this creates "Pocket005". All that is left to do now is to create a second PolarPattern based on Pocket005.

The end result is this:
Image

That's it! Of course there are other ways to do it, but at least you have an idea now what's possible.

Don't hesitate to ask questions if you need clarifications.

Cheers,

Norm!
Attachments
buick455s_box_normandc.fcstd
(63.34 KiB) Downloaded 198 times
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: noob question

Post by NormandC »

Hey buick455,

Would you mind if I used this example for a tutorial on the wiki? I occasionally create these mini-tutorials in forum replies but after a while I can't locate them anymore (the forum search sucks big time). This might help other people. :)
buick455
Posts: 14
Joined: Sun Mar 10, 2013 8:55 pm

Re: noob question

Post by buick455 »

normandc wrote:Hey buick455,

Would you mind if I used this example for a tutorial on the wiki? I occasionally create these mini-tutorials in forum replies but after a while I can't locate them anymore (the forum search sucks big time). This might help other people. :)
I have 2 things to say:
1. Holycrap, TY, your way seems alot better then what I was doing. In the morning I'm going to follow along and re-build it following along with your tut above.. If I get stumped it will let you know what you need to add to the tut (Got to be other ppl almost as clueless as I am :lol: )

2. Yeah, go for it.. wiki away!! I hope it helps folks like me (and saves you some keystrokes in the future :D )

oh and yes RR boards = RepRap forum. That MendelMax 1.5 is slick, I just have a oversized Prusa i2. I hope after I get the hang of FreeCad I can design myself a replacement for it (thats actually the reason I started toying with OpenScad). Don't get me wrong, its a great little printer but honestly wish I waited and spent a little more money and bought a MendelMax kit instead. My Prusa i2 is a bit finicky, prolly b/c I oversized it to get more Z (not that I ever use the added height other then the time I printed the Pink Panther Lady http://www.thingiverse.com/thing:1216 :) . Its like it needs to be tweaked before every print, its a lil flimsy even with cross supports added. I have been eyeball'n Wired1's OB 1.4 http://www.thingiverse.com/thing:41967 Looks like a good cross between the MM and the new Prusa i3.

Again Ty so much for your help.
keithsloan52
Veteran
Posts: 2753
Joined: Mon Feb 27, 2012 5:31 pm

Re: noob question

Post by keithsloan52 »

What I have been trying to do is re-create an object I created in Openscad (which also took forever b/c I was learning as I went). I think FreeCad will give me more flexibility (the ability to use the mouse and see whats being made before hitting F6 helps too). I am uploading a pic of my object from Openscad & my attempt in FreeCad so you can see my progress (or lack there of). Some things from the pic are missing from the FreeCad model (didn't want to bite off more then I could chew).
Is the original OpenSCAD scad file available. I would like to use it as test case for the FreeCAD import of scad files
buick455
Posts: 14
Joined: Sun Mar 10, 2013 8:55 pm

Re: noob question

Post by buick455 »

keithsloan52 wrote: Is the original OpenSCAD scad file available. I would like to use it as test case for the FreeCAD import of scad files
Sure, but be warned I only started using Openscad like a week or two ago, lol.. Its actually 2 files (the object and the config) so I don't know if that will screw up what your trying to do..

!! WARNING !! THE FILES BELOW SHOULD NOT BE USED AS AN EXAMPLE OF PROPER OPENSCAD USAGE !!
(I only understand Openscad enough to get myself in trouble)

Ok, now that I got my point across I hope Here ya go!
Attachments
Openscad_Testrun.zip
(1.25 KiB) Downloaded 100 times
keithsloan52
Veteran
Posts: 2753
Joined: Mon Feb 27, 2012 5:31 pm

Re: noob question

Post by keithsloan52 »

Ok, now that I got my point across I hope Here ya go!
Thanks - Okay I downloaded the file and unzipped it to extract the two files.
I then opened Testrun.scad in FreeCAD and it loaded just file. :D
Well it looks just fine to me.

Obviously ImportCSG.py created boolean CSG model rather than sketches. But importing the file would have saved you
having to create from scratch in FreeCAD. Maybe you did not realise that FreeCAD has the ability to open OpenSCAD files.
You just have to tell FreeCAD where OpenSCAD is see https://sourceforge.net/apps/mediawiki/ ... in_FreeCAD

It has problems with files that have coincident faces, but that does not appear to be a problem with your file.
buick455
Posts: 14
Joined: Sun Mar 10, 2013 8:55 pm

Re: noob question

Post by buick455 »

normandc wrote: Don't hesitate to ask questions if you need clarifications.
Hey Norm, I'm working on the "lesson" you posted for me above and I can say I feel alot less intimidated by FreeCad then I did yesterday. I have had a few issues though.

After I got a few steps into the tut I realized I needed to deviate a little. Not b/c of anything you did but b/c of the part/model. A few of the features needed to be constant that you didn't know about. I will try an explain..

The main block is over sized on one side to accommodate a (in the future, when I'm better at this) smooth rod mounting clamp (look at the Openscad pic I posted). So the Top Recess pocket, Upper Round pocket, Large Hollow pocket & Lower Round pocket all needed to be centered on each other and also placed 27.5mm from left (look at my attachment might be less confusing then what I just typed).

By doing what I did to make the center origin also the center of the mentioned pockets I screwed myself from using the Polar Pattern Tool. I ended up using the "Equality Constraint = " and the "Symmetry Constraint >< " to get my holes which was alot better then the way I did it the other day but not as easy as the Polar Tool would have been.

My only problem with the tut so far is the part for the rectangular slots (I know the Polar Pattern Tool isn't going to work here either). My problem is with drawing the rectangle, lol.. I select the External geometry tool, then the circle (it highlights 3/4's of it) then I try to polyline the rectangle out and it throws my line down to the X axis.. I don't have a clue as to why. I would say maybe that part of the tut needs a little more details (or I'm over thinking it).

Other then that, so far I have learned a bunch.
Attachments
freecad day 004 (stuck at slots).FCStd
maybe I should have named this "stuck on stupid" lol
(40.19 KiB) Downloaded 109 times
buick455
Posts: 14
Joined: Sun Mar 10, 2013 8:55 pm

Re: noob question

Post by buick455 »

keithsloan52 wrote:
Ok, now that I got my point across I hope Here ya go!
Thanks - Okay I downloaded the file and unzipped it to extract the two files.
I then opened Testrun.scad in FreeCAD and it loaded just file. :D
Well it looks just fine to me.

Obviously ImportCSG.py created boolean CSG model rather than sketches. But importing the file would have saved you
having to create from scratch in FreeCAD. Maybe you did not realise that FreeCAD has the ability to open OpenSCAD files.
You just have to tell FreeCAD where OpenSCAD is see https://sourceforge.net/apps/mediawiki/ ... in_FreeCAD

It has problems with files that have coincident faces, but that does not appear to be a problem with your file.
Hello Keith,
Well your right I didn't know FreeCad could import OpenScad. I was just using that object as a goal, an object that I already knew the dimensions of. The Intent was to learn FreeCad and maybe never fool with OpenScad unless I have too.. I used Sketch-up for so long creating plans for projects (woodwork) that trying to use Openscad for my reprap models was just driving me back to Sketch-up (missed the mouse and all the typing sucked). I could draw all this stuff in Sketch-up in 1/4 the time it takes in Openscad & FreeCad but to change things in Sketch-up almost always requires a complete redraw which sucks.

I think the ultimate way would be a combo of the 3 mentioned. (just my opinion)
1. sketch out your object like you can in sketch-up (3d workspace is quick and push/pull is quicker).
2. have the ability to create config files (like my testrun_configuration.scad) that input variables into the final object (testrun.scad). This makes it easy for others to make changes (think improperly setup repraps & hole sizes :roll: )
3. have all the neat toys for filet, chamfer ect.. the polar tools (that I didn't get to use today).. the ability change things without a re-draw..
4. FREE :lol:
keithsloan52
Veteran
Posts: 2753
Joined: Mon Feb 27, 2012 5:31 pm

Re: noob question

Post by keithsloan52 »

I then opened Testrun.scad in FreeCAD and it loaded just file. :D
Well it looks just fine to me.
Actually there is a small bug, the rectangular holes don't go all the way through.
One can correct this by changing the height of cube004,cube005,cube006,cube007 to say 6mm.

Interesting that it get things right for cylinder holes. I would say this is a bug in either FreeCAD or OCC.
Be interested in other peoples view If its agreed its a bug I will post it on Mantis
Post Reply