Skip to content

Commit 1f74715

Browse files
authored
docs: document chip obstructsWithinBounds behavior (#252)
* docs: explain obstructsWithinBounds for chip * docs: tweak obstructsWithinBounds preview
1 parent 0df18d8 commit 1f74715

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

docs/elements/chip.mdx

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,93 @@ export default () => (
284284

285285
For more information about custom footprints, check out the [<footprint /> element](./footprint.mdx)
286286

287+
### `obstructsWithinBounds`
288+
289+
By default, `<chip />` components occupy all of the PCB area inside their
290+
footprint's bounding box, which prevents other components from being placed
291+
inside that region. Set `obstructsWithinBounds={false}` to indicate that the
292+
component leaves usable room within its outline (for example, when you are
293+
representing a tall module that allows other chips to sit underneath).
294+
295+
The example below manually constructs a footprint for a module-style chip and
296+
places a second chip inside its body. Because the outer chip has
297+
`obstructsWithinBounds={false}`, the inner chip—whose own
298+
`obstructsWithinBounds` prop remains `true`—can safely occupy the same PCB
299+
area.
300+
301+
<CircuitPreview
302+
splitView
303+
defaultView="3d"
304+
hideSchematicTab
305+
browser3d={false}
306+
browser3dView={false}
307+
code={`
308+
309+
export default () => (
310+
<board width="50mm" height="30mm">
311+
<chip
312+
name="Module"
313+
pcbX={0}
314+
pcbY={0}
315+
obstructsWithinBounds={false}
316+
footprint={
317+
<footprint>
318+
<smtpad
319+
portHints={["VIN"]}
320+
pcbX="-8mm"
321+
pcbY="4mm"
322+
width="2mm"
323+
height="2mm"
324+
shape="rect"
325+
/>
326+
<smtpad
327+
portHints={["GND"]}
328+
pcbX="8mm"
329+
pcbY="4mm"
330+
width="2mm"
331+
height="2mm"
332+
shape="rect"
333+
/>
334+
<smtpad
335+
portHints={["SCL"]}
336+
pcbX="-8mm"
337+
pcbY="-4mm"
338+
width="2mm"
339+
height="2mm"
340+
shape="rect"
341+
/>
342+
<smtpad
343+
portHints={["SDA"]}
344+
pcbX="8mm"
345+
pcbY="-4mm"
346+
width="2mm"
347+
height="2mm"
348+
shape="rect"
349+
/>
350+
<silkscreenpath
351+
route={[
352+
{ x: -12, y: -6 },
353+
{ x: 12, y: -6 },
354+
{ x: 12, y: 6 },
355+
{ x: -12, y: 6 },
356+
{ x: -12, y: -6 },
357+
]}
358+
/>
359+
</footprint>
360+
}
361+
/>
362+
<chip
363+
name="Sensor"
364+
pcbX={0}
365+
pcbY={0}
366+
obstructsWithinBounds={true}
367+
footprint="0402"
368+
/>
369+
</board>
370+
)
371+
`}
372+
/>
373+
287374
### Internally Connected Pins
288375

289376
Some chips, such as a standard 4 pin pushbutton, have pins that are internally

0 commit comments

Comments
 (0)