Creating Arcs in the Template Designer
Introduction to Arcs
Arcs are curved segments in a contour that can be used to create rounded corners, circles, and other curved shapes.
In the MDF Door App, arcs are defined using the following parameters:
- End Point (X, Y, Z): The destination point where the arc will end.
- Center Point (I, J): The center of the circle that defines the arc.
- Radius (R): The distance from the center point to any point on the arc.
- Direction (DS): Defines how the arc should be drawn (clockwise or counterclockwise).
Direction (DS) Parameter Explained
The Direction parameter controls how the arc is drawn between the start and end points:
0: ≤180° CW
A clockwise arc that is less than or equal to 180 degrees.
1: ≤180° CCW
A counterclockwise arc that is less than or equal to 180 degrees.
2: >180° CW
A clockwise arc that is greater than 180 degrees.
3: >180° CCW
A counterclockwise arc that is greater than 180 degrees.
Step-by-Step Guide to Creating an Arc
-
Start a contour or continue from an existing segment
Before adding an arc, you need to have a contour started with at least one point.
-
Switch to arc mode
Click the "Arc" button in the drawing mode section to switch from line to arc mode.
-
Define the end point
Enter the X, Y, and Z coordinates for where you want the arc to end.
-
Specify the center point
Enter the I and J values for the center of the circle that defines your arc. The center point determines how the arc curves.
-
Set the radius
Enter the radius value. Note that this should match the distance from the center to both the start and end points.
-
Choose the direction
Select one of the four direction options as described above.
-
Add the arc
Click the "Add Arc" button to add the arc segment to your contour.
Tips for Working with Arcs
- For a perfect quarter circle, set the end point at (center.x + radius, center.y) or similar positions.
- You can use variables in arc parameters, such as setting the radius to a variable value.
- The start point of your arc is automatically set to the end point of the previous segment.
- When editing an existing arc, click on it in the canvas to modify its properties.
- Make sure the radius matches the distance from the center to both the start and end points to avoid errors.
Creating a Full Circle Using Two Arcs
Since the template designer doesn't have a dedicated circle tool, you can create a perfect circle by combining two 180° arcs. This technique is commonly used in CNC programming and CAD systems.
Step-by-Step Instructions
Step 1: Define Your Circle Parameters
First, determine:
- Center Point: The center of your circle (e.g., X=50, Y=50)
- Radius: The radius of your circle (e.g., R=25)
- Starting Position: Where you want the circle to begin (e.g., rightmost point)
Step 2: Create the Starting Point
- Click "Add Start Point" button
- Set coordinates to:
X = centerX + radius, Y = centerY
- For our example:
X = 75, Y = 50, Z = 0
Step 3: Create the First Semicircle (Right to Left)
- Switch to Arc mode
- Set End Point:
X = centerX - radius, Y = centerY
- For our example:
X = 25, Y = 50, Z = 0
- Set Center Point:
I = centerX, J = centerY
- For our example:
I = 50, J = 50
- Set Radius:
R = 25
- Set Direction:
1 (≤180° CCW)
- Click "Add Arc"
Step 4: Create the Second Semicircle (Left to Right)
- The starting point is automatically set to the end of the first arc
- Set End Point:
X = centerX + radius, Y = centerY
- For our example:
X = 75, Y = 50, Z = 0
- Set Center Point:
I = centerX, J = centerY
- For our example:
I = 50, J = 50
- Set Radius:
R = 25
- Set Direction:
1 (≤180° CCW)
- Click "Add Arc"
Step 5: Close the Contour (Optional)
If you want a closed circle contour:
- Click the "Close Contour" button
- This will complete the circle and mark it as a closed shape
Alternative Circle Configurations
Clockwise Circle
For a clockwise circle, use:
- First arc: Direction
0 (≤180° CW)
- Second arc: Direction
0 (≤180° CW)
Top-to-Bottom Circle
Start from the top of the circle:
- Start Point:
X = centerX, Y = centerY + radius
- First arc end:
X = centerX, Y = centerY - radius
- Second arc end:
X = centerX, Y = centerY + radius
Using Variables for Parametric Circles
You can create parametric circles using variables:
- Define variables:
CX
(center X), CY
(center Y), R
(radius)
- Start Point:
X = CX + R, Y = CY
- First Arc End:
X = CX - R, Y = CY
- Center Points:
I = CX, J = CY
- Radius:
R = R
- Second Arc End:
X = CX + R, Y = CY
This allows you to easily modify the circle size and position by changing the variable values.
💡 Pro Tips
- Both arcs must have the same center point and radius for a perfect circle
- Use the same direction (both CW or both CCW) for both arcs
- The end point of the first arc becomes the start point of the second arc automatically
- You can create circles of any size by adjusting the radius value
- For very large circles, consider using the ">180°" direction options instead
MPR File Format for Arcs
When exported to an MPR file, arcs are defined using the KA descriptor with the following parameters:
$E2
KA
X=1400
Y=0
DS=0
R=B/2
Where:
- X, Y, Z: End point coordinates
- I, J: Circle midpoint coordinates
- DS: Rotary direction (0=≤180° CW, 1=≤180° CCW, 2=>180° CW, 3=>180° CCW)
- R: Radius