Adding formulas to constraints

In order to make the ellipse constrained with respect to the rectangle, you need to add more dimensional constraints to it. We will use dimensional constraints and formulas to align the ellipse with the center of the rectangle:

  1. Select the linear constraint from the Dimensional panel of the Parametric tab.
    1. Click on the ellipse, then click close to the midpoint of line AB, and then click close to line BC to place the dimensional constraint. Click again in the empty drawing area to apply the changes and exit out of the linear dimensional constraint. This will add the d3 dimensional constraint.
      1. Click the linear dimensional constraint again and click the ellipse, then click close to the midpoint of line AD, and then move the cursor close to line AB to place the dimensional constraint. Finally, click on the empty area to apply the changes and exit the linear dimensional constraint. This will add the d4 dimensional constraint.
        1. Double-click the d3 constraint and change its value to 1, which is half the length of line AD, or the width of the rectangle.
          1. Double-click the d4 constraint and change its value to 2, which is half the length of line AB, or the length of the rectangle.
          1. The ellipse will now sit exactly at the center of the rectangle, as shown in Figure 7.65:

          Figure 7. 65: Ellipse at the center of the rectangle 

          In this drawing, let's change the value of the d1 dimensional constraint once again. Double-click on the d1 constraint and type d1=3, and then click on the blank drawing area to apply the constraint. You will notice that although the length of the rectangle will now change to 3 units, the ellipse will remain where it was. Once again, the location of the ellipse will no longer be at the center of the rectangle.

          If you want to fix this issue so that no matter what value you use for the length or width of the rectangle, the ellipse remains at the center, then you need to add some formulas. The following are the steps for adding formulas to dimensional constraints:

          1. Double-click the d3 dimensional constraint and change its value to d3=d2/2, and then click anywhere in the blank drawing area to apply the changes and exit the dimensional constraint command: we have our first formula.
            1. In this case, the value of the d3 dimension is now linked to the d2 dimension, and it will now remain always half of d3, as defined in the formula, and hence the center of the ellipse will remain exactly at the center of line AD.
              1. For the other direction, we need to repeat the steps for  the d4 dimensional constraint. In this case, use d4=d1/2 as the value, and now we will have a drawing where the ellipse will always remain at the center of the rectangle.
              1. You can verify the results by changing the value of d1 or d2 to any value. The final drawing, with all the constraints and formulas, will look like Figure 7.66:

              Figure 7. 66: Final drawing with all constraints and formulas 

              Although we added a very simple formula here, you can make even more complex formulas involving other parameters, such as multiplication, factors, squares, and square roots.

              This was the parametric tool that you can use anywhere you want to link different parts of the geometries with parameters. We will use some of these parametric tools with dynamic blocks as well. With this topic we have also concluded this chapter and before we move on to the next chapter, let's summarize the topics we have discussed so far.

              ..................Content has been hidden....................

              You can't read the all page of ebook, please click here login for view all page.
              Reset
              13.58.137.218