Skip to content

Commit a763a0a

Browse files
committed
Add working STEP cadmodel docs example with bundled SOIC-8 asset and live preview
1 parent 66254f9 commit a763a0a

2 files changed

Lines changed: 27307 additions & 3 deletions

File tree

docs/elements/cadmodel.mdx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,35 @@ You can provide a STEP model to the `<cadmodel />` element by setting the `stepF
133133
When providing a STEP model, the STEP model will be used when exporting to STEP to
134134
preserve the exact geometry of the model.
135135

136-
> **Example coming soon!**
137-
138-
136+
<CircuitPreview
137+
splitView
138+
defaultView="3d"
139+
hidePCBTab
140+
hideSchematicTab
141+
browser3dView={false}
142+
mainComponentPath="index.tsx"
143+
fsMap={{
144+
"index.tsx": `
145+
import soic8StepUrl from "./models/soic8.step"
139146
147+
export default () => (
148+
<board>
149+
<chip
150+
name="U1"
151+
footprint="soic8"
152+
cadModel={
153+
<cadmodel
154+
modelUrl="https://modelcdn.tscircuit.com/jscad_models/soic8.step"
155+
stepFileUrl={soic8StepUrl}
156+
/>
157+
}
158+
/>
159+
</board>
160+
)
161+
`,
162+
"./models/soic8.step": "__STATIC_ASSET__",
163+
}}
164+
/>
140165

141166
### Translucent Model in cadmodel
142167

0 commit comments

Comments
 (0)