Bird
0
0
PCB Designbi_tool

Component placement strategy in PCB Design - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Concept Flow
Component Placement Strategy Flow:

[Start] --> [Identify Components] --> [Assign Coordinates (X, Y)] --> [Set Rotation Angle] --> [Filter Components by Rotation] --> [Calculate Average X Position] --> [Result]
This flow shows the steps to place components on a PCB, assign their positions and rotations, filter by rotation angle, and calculate an average X position for selected components.
Formula
Components = [ {"Name": "R1", "X": 10, "Y": 20, "Rotation": 0}, {"Name": "C1", "X": 15, "Y": 25, "Rotation": 90}, {"Name": "U1", "X": 5, "Y": 10, "Rotation": 180}, {"Name": "J1", "X": 0, "Y": 0, "Rotation": 270} ] Filtered = [c for c in Components if c["Rotation"] in (0, 90)] AverageX = sum(c["X"] for c in Filtered) / len(Filtered) print(AverageX)

This code snippet shows how to filter components by rotation angle 0 or 90 degrees and calculate the average X position of those filtered components.

Step-by-Step Trace
ComponentX Position (mm)Y Position (mm)Rotation (deg)
R110200
C1152590
U1510180
J100270
Table shows component placement data used for filtering and calculation.
Variable Tracker
StepVariableValueExplanation
1Filtered[{'Name': 'R1', 'X': 10, 'Y': 20, 'Rotation': 0}, {'Name': 'C1', 'X': 15, 'Y': 25, 'Rotation': 90}]Components with rotation 0 or 90 degrees
2X positions[10, 15]X values of filtered components
3AverageX12.5Average of X positions (10 + 15) / 2
Key Moments
Which components are selected based on rotation?
How is the average X position calculated?
Why are U1 and J1 excluded from the calculation?
Sheet Trace Quiz - 3 Questions
Test your understanding
Which components are included when filtering by rotation 0 or 90 degrees?
AU1 and J1
BR1 and C1
CAll components
DOnly J1
Key Result
Component placement strategy involves assigning X and Y coordinates and rotation angles to components on a PCB. Filtering components by rotation angle allows focused calculations like average position for specific orientations.
Transcript
We start with a list of components each having X, Y positions and a rotation angle. We filter components to keep only those with rotation 0 or 90 degrees. Then we extract their X positions and calculate the average. This average helps understand placement trends for components oriented in these directions.