-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
341 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,6 @@ dist-ssr | |
.aider* | ||
.vercel | ||
.env | ||
|
||
.yalc | ||
yalc.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { CadViewer } from "src/CadViewer" | ||
import { Circuit } from "@tscircuit/core" | ||
|
||
const createCircuit = () => { | ||
const circuit = new Circuit() | ||
|
||
circuit.add( | ||
<board width="10mm" height="10mm"> | ||
<footprint> | ||
<silkscreentext | ||
text="bottom_L" | ||
pcbX={0} | ||
pcbY={0} | ||
anchorAlignment="bottom_left" | ||
pcbRotation={0} | ||
layer="top" | ||
fontSize={0.25} | ||
/> | ||
<silkscreentext | ||
text="top_L" | ||
pcbX={0} | ||
pcbY={0} | ||
anchorAlignment="top_left" | ||
pcbRotation={0} | ||
layer="top" | ||
fontSize={0.25} | ||
/> | ||
<silkscreentext | ||
text="bottom_R" | ||
pcbX={0} | ||
pcbY={0} | ||
anchorAlignment="bottom_right" | ||
pcbRotation={0} | ||
layer="top" | ||
fontSize={0.25} | ||
/> | ||
<silkscreentext | ||
text="top_R" | ||
pcbX={0} | ||
pcbY={0} | ||
anchorAlignment="top_right" | ||
pcbRotation={0} | ||
layer="top" | ||
fontSize={0.25} | ||
/> | ||
<silkscreentext | ||
text="center" | ||
pcbX={0} | ||
pcbY={1} | ||
anchorAlignment="center" | ||
pcbRotation={0} | ||
layer="bottom" | ||
fontSize={0.25} | ||
/> | ||
</footprint> | ||
</board>, | ||
) | ||
|
||
return circuit.getCircuitJson() | ||
} | ||
|
||
export const SilkscreenText = () => { | ||
const circuitJson = createCircuit() | ||
return <CadViewer soup={circuitJson as any} /> | ||
} | ||
|
||
export default { | ||
title: "Silkscreen Text", | ||
component: SilkscreenText, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { CadViewer } from "src/CadViewer" | ||
import { Circuit } from "@tscircuit/core" | ||
|
||
const createCircuit = () => { | ||
const circuit = new Circuit() | ||
|
||
circuit.add( | ||
<board width="10mm" height="10mm"> | ||
<footprint> | ||
<silkscreentext | ||
text="abcdefghijklmnopqrstuvwxyz" | ||
pcbX={0} | ||
pcbY={0} | ||
pcbRotation={0} | ||
layer="top" | ||
fontSize={0.25} | ||
/> | ||
<silkscreentext | ||
text="ABCDEFGHIJKLMNOPQRSTUVWXYZ" | ||
pcbX={0} | ||
pcbY={2} | ||
pcbRotation={0} | ||
fontSize={0.25} | ||
layer="top" | ||
/> | ||
</footprint> | ||
</board>, | ||
) | ||
|
||
return circuit.getCircuitJson() | ||
} | ||
|
||
export const SilkscreenTextAlphabet = () => { | ||
const circuitJson = createCircuit() | ||
return <CadViewer soup={circuitJson as any} /> | ||
} | ||
|
||
export default { | ||
title: "Silkscreen Text", | ||
component: SilkscreenTextAlphabet, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { CadViewer } from "src/CadViewer" | ||
import { Circuit, SilkscreenText } from "@tscircuit/core" | ||
|
||
const createCircuit = () => { | ||
const circuit = new Circuit() | ||
|
||
circuit.add( | ||
<board width="20mm" height="20mm"> | ||
<footprint> | ||
<silkscreentext text="A" /> | ||
</footprint> | ||
</board>, | ||
) | ||
|
||
return circuit.getCircuitJson() | ||
} | ||
|
||
export const SilkscreenTextCenter = () => { | ||
const circuitJson = createCircuit() | ||
return <CadViewer soup={circuitJson as any} /> | ||
} | ||
|
||
export default { | ||
title: "Silkscreen Text", | ||
component: SilkscreenTextCenter, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { CadViewer } from "src/CadViewer" | ||
import { Circuit } from "@tscircuit/core" | ||
|
||
const createCircuit = () => { | ||
const circuit = new Circuit() | ||
|
||
circuit.add( | ||
<board width="10mm" height="10mm"> | ||
<footprint> | ||
<silkscreentext | ||
text="1234567890" | ||
pcbX={0} | ||
pcbY={0} | ||
fontSize={0.25} | ||
layer="top" | ||
/> | ||
</footprint> | ||
</board>, | ||
) | ||
|
||
return circuit.getCircuitJson() | ||
} | ||
|
||
export const SilkscreenTextNumbers = () => { | ||
const circuitJson = createCircuit() | ||
return <CadViewer soup={circuitJson as any} /> | ||
} | ||
|
||
export default { | ||
title: "Silkscreen Text", | ||
component: SilkscreenTextNumbers, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { CadViewer } from "src/CadViewer" | ||
import { Circuit, SilkscreenText } from "@tscircuit/core" | ||
|
||
const createCircuit = () => { | ||
const circuit = new Circuit() | ||
|
||
circuit.add( | ||
<board width="20mm" height="20mm"> | ||
<resistor | ||
name="R1" | ||
footprint="0805" | ||
resistance="10k" | ||
pcbX={10} | ||
pcbY={0} | ||
/> | ||
<resistor | ||
name="R2" | ||
footprint="0805" | ||
resistance="10k" | ||
pcbX={-10} | ||
pcbY={0} | ||
/> | ||
<resistor | ||
name="R3" | ||
footprint="0805" | ||
resistance="10k" | ||
pcbX={0} | ||
pcbY={-10} | ||
/> | ||
<resistor | ||
name="R4" | ||
footprint="0805" | ||
resistance="10k" | ||
pcbX={0} | ||
pcbY={10} | ||
/> | ||
<trace from={".R1 > .right"} to={".R2 > .left"} /> | ||
<trace from={".R4 > .right"} to={".R3 > .left"} /> | ||
<footprint> | ||
<silkscreentext text="Tscircuit" pcbX={0} pcbY={1.6} /> | ||
</footprint> | ||
</board>, | ||
) | ||
|
||
return circuit.getCircuitJson() | ||
} | ||
|
||
export const SilkscreenTextOnTraces = () => { | ||
const circuitJson = createCircuit() | ||
return <CadViewer soup={circuitJson as any} /> | ||
} | ||
|
||
export default { | ||
title: "Silkscreen Text", | ||
component: SilkscreenTextOnTraces, | ||
} |