MustafaMulla29/MC-MP-symbols
This code defines a 10mm x 10mm schematic diagram featuring two integrated circuit components ("MC" and "MP") with their respective physical symbols, including outer rings, lobed shapes, connection lines, and ports.
Usage: To use this package, import the components from "@tsci/MustafaMulla29.MC-MP-symbols": ```tsx import { MC, MP } from "@tsci/MustafaMulla29.MC-MP-symbols" export default () => ( <board> <MC name="U1" /> <MP name="U2" schX={3} /> </board> ) ``` The package provides two components: - `MC`: A circuit symbol with a shaft port - `MP`: A circuit symbol with a signal port You can place these components on a board and customize their positioning using standard tscircuit props.
- Version
- 0.0.1
- License
- unset
- Stars
- 0
dist/index.js
PCB
Schematic
import { jsxs, jsx } from 'react/jsx-runtime';
function buildMcInnerPoints() {
const R = 0.145; // center circle radius (bigger)
const L = 0.32; // arm length (taller)
const Wb = 0.04; // arm half-width at BASE (slightly wider)
const Wt = 0.08; // arm half-width at TIP (restored)
const segments = 8; // points per arc (smoother curves)
// Helper to generate elliptical arc points (elongated tips)
function ellipticalArcPts(cx, cy, rx, ry, startDeg, endDeg) {
const pts = [];
const startRad = (startDeg * Math.PI) / 180;
const endRad = (endDeg * Math.PI) / 180;
for (let i = 0; i <= segments; i++) {
const a = startRad + (endRad - startRad) * (i / segments);
pts.push({ x: cx + rx * Math.cos(a), y: cy + ry * Math.sin(a) });
}
return pts;
}
// Helper to generate circular arc points (for center)
function arcPts(cx, cy, r, startDeg, endDeg) {
return ellipticalArcPts(cx, cy, r, r, startDeg, endDeg);
}
const pts = [];
// TOP ARM (concave sides - narrower at base, wider at tip)
pts.push({ x: -Wb, y: R }); // left base (narrow)
pts.push({ x: -Wt, y: L }); // left side to tip (wide)
pts.push(...ellipticalArcPts(0, L, Wt, Wt * 0.4, 180, 0).slice(1)); // elliptical tip arc (flatter)
pts.push({ x: Wb, y: R }); // right side back (narrow at base)
// Center arc from TOP to RIGHT
pts.push(...arcPts(0, 0, R, 70, 20).slice(1));
// RIGHT ARM (concave sides)
pts.push({ x: R, y: Wb }); // top base (narrow)
pts.push({ x: L, y: Wt }); // top side to tip (wide)
pts.push(...ellipticalArcPts(L, 0, Wt * 0.4, Wt, 90, -90).slice(1)); // elliptical tip arc (flatter)
pts.push({ x: R, y: -Wb }); // bottom side back (narrow at base)
// Center arc from RIGHT to BOTTOM
pts.push(...arcPts(0, 0, R, -20, -70).slice(1));
// BOTTOM ARM (concave sides)
pts.push({ x: Wb, y: -R }); // right base (narrow)
pts.push({ x: Wt, y: -L }); // right side to tip (wide)
pts.push(...ellipticalArcPts(0, -L, Wt, Wt * 0.4, 0, -180).slice(1)); // elliptical tip arc (flatter)
pts.push({ x: -Wb, y: -R }); // left side back (narrow at base)
// Center arc from BOTTOM to LEFT
pts.push(...arcPts(0, 0, R, -110, -160).slice(1));
// LEFT ARM (concave sides)
pts.push({ x: -R, y: -Wb }); // bottom base (narrow)
pts.push({ x: -L, y: -Wt }); // bottom side to tip (wide)
pts.push(...ellipticalArcPts(-L, 0, Wt * 0.4, Wt, 270, 90).slice(1)); // elliptical tip arc (flatter)
pts.push({ x: -R, y: Wb }); // top side back (narrow at base)
// Center arc from LEFT back to TOP
pts.push(...arcPts(0, 0, R, 160, 110).slice(1));
return pts;
}
const MCSymbol = (jsxs("symbol", { children: [jsx("schematiccircle", { center: { x: 0, y: 0 }, radius: 0.45, isFilled: false, strokeWidth: 0.02 }), jsx("schematicpath", { isFilled: false, points: buildMcInnerPoints() }), jsx("schematicline", { x1: 0.45, y1: 0, x2: 1.0, y2: 0, strokeWidth: 0.02 }), jsx("schematiccircle", { center: { x: 1, y: 0 }, radius: 0.06, isFilled: false, strokeWidth: 0.02 }), jsx("port", { name: "shaft", direction: "right", schX: 1.08, schY: 0 })] }));
function buildMpPoints() {
const shaftH = 0.05;
const midH = 0.08; // middle section height
const blockH = 0.12; // block and short section height
const stepH = 0.09; // long section height
const noseR = shaftH;
const shaftLen = 0.2; // shaft after nose (longer)
const midLen = 0.35; // line at mid height (second line - longer)
const shortLen = 0.02; // SHORT section (third line - longer)
const longLen = 0.3; // LONG section
const blockW = 0.12;
const noseCx = -0.55;
const shaftEnd = noseCx + noseR + shaftLen; // end of shaft
const midEnd = shaftEnd + midLen; // end of mid section
const shortEnd = midEnd + shortLen; // end of SHORT section
const longEnd = shortEnd + longLen; // end of LONG section
const blockRight = longEnd + blockW; // end of block
const pts = [];
const noseRight = noseCx + noseR; // rightmost point of nose arc
pts.push({ x: noseRight, y: -shaftH });
const segs = 12;
for (let i = 0; i <= segs; i++) {
const a = -Math.PI / 2 - (Math.PI * i) / segs;
pts.push({
x: noseCx + noseR * Math.cos(a),
y: noseR * Math.sin(a),
});
}
pts.push({ x: shaftEnd, y: shaftH });
pts.push({ x: shaftEnd, y: midH });
pts.push({ x: midEnd, y: midH });
pts.push({ x: midEnd, y: blockH });
pts.push({ x: shortEnd, y: blockH });
pts.push({ x: shortEnd, y: stepH });
pts.push({ x: longEnd, y: stepH });
pts.push({ x: longEnd, y: blockH });
pts.push({ x: blockRight, y: blockH });
pts.push({ x: blockRight, y: -blockH });
pts.push({ x: longEnd, y: -blockH });
pts.push({ x: longEnd, y: -stepH });
pts.push({ x: shortEnd, y: -stepH });
pts.push({ x: shortEnd, y: -blockH });
pts.push({ x: midEnd, y: -blockH });
pts.push({ x: midEnd, y: -midH });
pts.push({ x: shaftEnd, y: -midH });
pts.push({ x: shaftEnd, y: -shaftH });
pts.push({ x: noseRight, y: -shaftH });
return pts;
}
const MPSymbol = (jsxs("symbol", { children: [jsx("schematicpath", { isFilled: false, points: buildMpPoints() }), jsx("schematicline", { x1: 0.48, y1: 0, x2: 0.85, y2: 0, strokeWidth: 0.02 }), jsx("schematiccircle", { center: { x: 0.85, y: 0 }, radius: 0.06, isFilled: false, strokeWidth: 0.02 }), jsx("port", { name: "shaft", direction: "right", schX: 0.98, schY: 0 })] }));
var index = () => (jsxs("board", { width: "10mm", height: "10mm", children: [jsx("chip", { name: "MC", symbol: MCSymbol }), jsx("chip", { name: "MP", schX: 4, symbol: MPSymbol })] }));
export { index as default };