05 - Core Tools and Analysis
Purpose: To explain tools directly related to the design and analysis of the conduit and wiring plan on the canvas.
Key Sections
Measuring Distances (using the "Measure" tool)
The "Measure" tool allows you to determine distances on your plan.
- Initiating Measurement: You can start the measurement tool from the "Tools" menu.
- Process:
- After selecting the "Measure" tool, the application will prompt you to click the first point on the canvas.
- Once the first point is clicked, a marker will be placed, and the application will prompt for the second point.
- Upon clicking the second point, another marker is placed.
- The application then calculates the Euclidean distance between these two points in original image pixel units.
- This distance is then formatted based on the current scale (e.g., feet or pixels) and displayed to you in a dialog box.
- Visual Feedback: Markers are drawn on the canvas at the clicked points during the measurement process.
- Cancellation: The measurement process can be cancelled by pressing the Escape key.
- Scale Requirement: For measurements to be meaningful in real-world units (like feet), the drawing scale must be defined first. If no scale is set, distances will be reported in pixels.
Adding and Managing Obstacles
Obstacles are defined areas on the canvas that the conduit path should avoid.
- Initiating Obstacle Definition:
- You can start adding an obstacle through the "Tools" menu by selecting an "Add Obstacle" option.
- The application requires an image to be loaded before an obstacle can be defined.
- Defining Obstacle Shape:
- Obstacles are defined as rectangular areas.
- The process involves two clicks on the canvas to define two opposite corners of the rectangle.
- During the process (after the first click and before the second), a temporary dashed rectangle is drawn to visualize the obstacle being defined.
- Storing Obstacles:
- Once the second point is clicked, the obstacle's bounding box coordinates (in original image units) are stored.
- Obstacles are managed internally for efficient collision detection during conduit path calculations.
- Visual Representation:
- Permanent obstacles are drawn on the canvas, with a gray fill color, outline, and stipple pattern to distinguish them.
- Selecting Obstacles:
- You can select a defined obstacle by clicking on it.
- Selected obstacles are highlighted with gold styling (e.g., fill color, outline color, outline width, stipple pattern).
- Deleting Obstacles:
- Selected obstacles can be deleted by pressing the Delete key or via a context menu option.
- Deleting an obstacle will remove it from the internal data and the canvas will be updated.
- Impact on Conduit Calculation:
- Defined obstacles are considered during the conduit path calculation. The pathing algorithm will attempt to route conduits around these areas.
- Adding or deleting obstacles invalidates the current conduit path and requires a recalculation.
Managing Node Elevations
Node elevations allow you to define a vertical change (rise or drop) associated with a connection point. This impacts the calculated length of wires and vertical conduit runs.
- Concept: Each node can have an
elevation_delta
attribute. This value represents a vertical distance from the 2D plane of the drawing. - Default Value: When a node is created, its
elevation_delta
is initialized to 0.0. - Changing Elevation:
- You can change the elevation delta for a selected node through a right-click context menu option ("Change Elevation").
- A dialog prompts you to enter the new elevation change. The input is expected in the current scale units (e.g., feet or pixels).
- The entered value must be non-negative.
- Impact on Wire Lengths:
- When calculating the total length of a wire run between two nodes, the
elevation_delta
of both the start and end nodes is added to the 2D path length along the conduit. - This provides a more accurate estimation of the actual wire needed.
- When calculating the total length of a wire run between two nodes, the
- Impact on Conduit Lengths:
- The sum of elevation deltas for nodes involved in vertical conduit runs contributes to the total conduit length.
- Impact on Vertical Conduit Sizing:
- Nodes with a non-zero
elevation_delta
require a vertical conduit run. - The application calculates the size of this vertical conduit based on all wires terminating at that node (i.e., wires that start or end at this node and thus traverse the vertical section).
- Nodes with a non-zero
- Recalculations:
- Changing a node's elevation triggers:
- Recalculation of vertical conduit sizes for that node.
- An update to the total wire and conduit lengths displayed.
- Changing a node's elevation triggers:
- Display:
- When a node is selected or hovered over, its elevation delta and the calculated vertical conduit size are displayed in the status bar or a tooltip.
Understanding Junctions and Bends
Junctions and bends are critical components of a conduit system, affecting installation complexity and material requirements.
- Junctions:
- Definition: Junction points in the context of this tool represent locations where three or more conduit segments meet. These are distinct from the user-defined nodes (devices/endpoints).
- Determination:
- Junction points correspond to points on the path where the degree of connection (number of segments meeting) is 3 or more, and which are not original nodes.
- The application calculates these junction points after the main conduit path is determined.
- Visual Representation: Junctions are marked visually on the canvas with a small box ( colored gold) and a "J" label.
- Counting: The total number of such junction points is calculated and can be displayed in summaries or the status bar.
- Path Simplification: Path simplification algorithms aim to reduce the number of unnecessary junctions or shift them to more optimal locations.
- Bends:
- Definition: Bends refer to 90-degree turns in the orthogonal conduit path.
- Determination:
- Bends occur at points where the conduit path changes direction (e.g., from horizontal to vertical).
- The system calculates the total number of bends in the overall conduit path.
- Crucially, points that are original user-defined nodes or junctions (where 3 or more segments meet) are not counted as simple bends, as these locations would involve fittings other than just a bend (e.g., T-junction boxes, connections to devices). The count focuses on degree-2 corners in the path.
- Calculation Method:
- The application determines the "degree" of each point in the calculated conduit path (how many segments connect to it).
- A point is considered a bend if its degree is exactly 2 and it's not an original node.
- Display: The total bend count for the entire conduit system is displayed in summaries or the status bar.
- Bends per Connection: The tool can also calculate the number of bends along the specific conduit path taken between any two user-defined nodes. This involves:
- Finding the shortest path segments on the conduit graph between the two nodes.
- Analyzing the points along this specific path. A point on this path is counted as a bend if its degree within this specific path is 2 and it's not an original node.
- Impact: Both junctions and bends add to the complexity and cost of a conduit installation. Accurately identifying and counting them is important for estimation.
Finding the Longest Wire
This feature helps identify the maximum length of any single wire run within the designed system, considering both the 2D path along the conduit and any vertical rises/drops due to node elevations.
- Purpose: To determine the maximum continuous length of wire needed for any single connection, which can be important for voltage drop calculations, wire pulling limits, and ordering appropriate wire spool lengths.
- Prerequisites:
- A valid conduit path must be calculated.
- Wiring connections (which wires go between which nodes) must be defined.
- Calculation Process:
- The tool iterates through all defined directed wiring connections.
- For each connection between a start node and an end node:
- It retrieves the 2D path length between these nodes from the pre-calculated distance matrix.
- It fetches the
elevation_delta
(vertical rise/drop) for both the start node and the end node. - The total run length for this specific connection is calculated as:
2D Path Length + Start Node Elevation_px + End Node Elevation_px
. - This calculated total run length is compared against the current maximum found so far. If it's greater, it becomes the new maximum, and the details (start node name, end node name, and this length) are stored.
- Output:
- The result is displayed in a dialog box or message.
- The output includes:
- The names of the two nodes that form the longest wire run.
- The calculated maximum length, formatted into appropriate units (e.g., feet or pixels) based on the current scale.
- Access: This functionality is available through the "Tools" menu.
Finding the Connection with Most Bends
This tool identifies which specific pair of connected nodes has the path between them with the highest number of 90-degree bends along the conduit.
- Purpose: Helps to identify potentially complex or difficult wire pulls. A high number of bends can increase friction and make pulling wire more challenging, potentially requiring more pull points or specific lubrication.
- Prerequisites:
- A valid conduit path must be defined.
- Calculation Process:
- The tool iterates through all unique pairs of user-defined nodes in the system.
- For each pair of nodes:
- It first checks if there's a valid (finite distance) path between them.
- It retrieves the actual sequence of conduit segments that form the shortest path between these two nodes on the conduit graph.
- Using this specific path's segments and the degree information, it calculates the number of bends along this particular path.
- A point on this path is counted as a bend if:
- It has a degree of 2 within this specific path (i.e., it's a corner in this path).
- It is not one of the original user-defined nodes.
- A point on this path is counted as a bend if:
- The calculated bend count for this pair's path is compared against the maximum bend count found so far. If it's higher, this pair and their bend count become the new "most bends" record.
- Output:
- The result is displayed in a dialog box.
- The output includes:
- The names of the two nodes that form the connection with the most bends.
- The number of bends on that path.
- If no bends are found, or if no valid paths exist, an appropriate message is shown.
- Access: This functionality is available through the "Tools" menu.