Classes
PCB
The main class that represents the entire circuit.
import { PCB } from '@typecad/typecad';
let typecad = new PCB('typecad_concepts', {thickness: 1.6, copper_thickness: 35 });
Optional properties are: {thickness: 1.6, copper_thickness: 35 }
- thickness — board thickness in mm
- copper_thickness — copper thickness in microns (1 oz = 35 microns)
These are used in power-aware calculations.
The PCB
class is where:
- Components are added
- Connections are made between components
- utility functions like ERC and BOM
Component
The Component
class represents individual parts like resistors, capacitors, ICs, etc. You add a Component
to your PCB
.
import { Component } from '@typecad/typecad';
let R1 = new Component({ value: '1kohm' });
- reference — reference designator
- value — value of component
- footprint — footprint
- prefix — prefix for reference designator
- datasheet — link to component datasheet
- description — description of component
- voltage — voltage rating of component
- wattage — wattage rating of component
- mpn — Manufacturer Part Number
- dnp — true if component is Do Not Populate, false to place component
- simulation — an object with simulation data
{ include: true, model: 'ngspice-model' }
Syntax
typeCAD makes use of the above syntax style for many of its classes, ie. passing an object of optional properties. Optional in terms of TypeScript code, if a particular property isn’t passed and typeCAD requires it, it will throw an error during build.
Power
Represents a power source like a battery or voltage regulator.
import { Power } from '@typecad/typecad';
let coin_cell = new Power({ power: holder.pin(1), gnd: holder.pin(2), voltage: 3.7 });
- power — pin on a component that supplies power
- gnd — pin on a component that supplies ground
- voltage — voltage of power source
On This Page