FreeCAD Tip - Expressions

You can link several part dimensions to a single (or a few) primary dimensions using formulas or equations from the constraint dialog boxes. The FreeCAD wiki page (wiki.freecad.org/Expressions) calls these "Expressions," and has a wealth of information for using them. Here, I demonstrate the syntax and use of functions referencing objects such as constraints in a sketch, and conditional constraints. Use the wiki page to get more ideas and go wild!

Пікірлер: 8

  • @yootoobgoog
    @yootoobgoog2 ай бұрын

    Great example. Exactly what I was looking for. Thanks

  • @viesic
    @viesic Жыл бұрын

    You could name original diameter something like: "outside_diameter" and then in other constraints use that name and not numerical value. Something like ".Constraints.outside_diameter * 0.5"

  • @CrapE_DM
    @CrapE_DM11 ай бұрын

    Clicked on this because the thumbnail made me think that it was a video about the differences between using f(x) and =. Then I saw that you were going to do a conditional expression, which I was wondering for a while if FreeCAD could do. Don't know why I didn't just look it up :) Thanks for sharing

  • @bmarvin6339
    @bmarvin63396 ай бұрын

    Thank you for this easy to follow example. Constraints as expressions of other dimensions is what truly makes FreeCAD a parametric modeler. It seams like 90% of the FreeCAD videos are “for beginners” and only show each constraint being given a fixed constant value. I can make those kind of parts in plain AutoCAD 3D solids that are fixed with the “parameters” determined at original solid primitives creation. Expressions of constraints, in my mind, is what makes FreeCAD a true parametric 3D CAD modeler. Your explanations were very clear and well presented. Also, thank you for referencing the FreeCAD documentation of “expressions”. I wanted a model of a netting gauge that is simply a rectangle where the length is twice the width. A very simple relationship used for making various size nets of different opening sizes for cargo netting in either paracord or elastic cord (bungee cord). Now I have one netting gauge model that can create STL files to print for many netting gauge sizes.

  • @mikepennington8088
    @mikepennington80888 ай бұрын

    You are doing it the hard way. Just create a Freecad spreadsheet and put all of the dimensions in there. You can use expressions to derive one dimension from another there. That way the sketches, pads, pockets, etc. are always dependent on a single value from the spreadsheet. That way if you need to change the derivation of a given value, it is done in only the spreadsheet. No references need to be touched. In your method, if you have multiple dimensions with the same derivation, each would still have to be changed. Yes, it works, but the spreadsheet method is infinitely more maintainable.

  • @ccmoonie
    @ccmoonie Жыл бұрын

    I enjoyed this. Good stuff!

  • @yuriyyatsyshyn9717
    @yuriyyatsyshyn97174 ай бұрын

    Nice work. How about names for size? And use it in formulas.