import {
SYMBOL_ACCENT,
SYMBOL_FILL,
SYMBOL_MUTED,
SYMBOL_STROKE,
SymbolSvg,
} from "./primitives";
const PNEUMATIC_STROKE_WIDTH = 1.7;
const PNVO001_STROKE = "#8b134f";
const ORIFICE_CONTENT_SCALE = 0.6;
const ORIFICE_CONTENT_CENTER = { x: 32, y: 24 } as const;
const ORIFICE_CONTENT_TRANSFORM = `translate(${ORIFICE_CONTENT_CENTER.x} ${ORIFICE_CONTENT_CENTER.y}) scale(${ORIFICE_CONTENT_SCALE}) translate(${-ORIFICE_CONTENT_CENTER.x} ${-ORIFICE_CONTENT_CENTER.y})`;
function scaledOrificePoint(x: number, y: number) {
return {
x:
ORIFICE_CONTENT_CENTER.x +
(x - ORIFICE_CONTENT_CENTER.x) * ORIFICE_CONTENT_SCALE,
y:
ORIFICE_CONTENT_CENTER.y +
(y - ORIFICE_CONTENT_CENTER.y) * ORIFICE_CONTENT_SCALE,
};
}
export const PNVO001_PORT_ANCHORS = {
physicalLeft: scaledOrificePoint(0, 24),
physicalRight: scaledOrificePoint(64, 24),
signal: scaledOrificePoint(24.25, 56),
} as const;
type OrificeControl = "none" | "fixed" | "signal";
function Pnvo001Body({ control }: { control: OrificeControl }) {
return (
{control === "none" ? null : (
<>
>
)}
{control === "signal" ? (
) : null}
);
}
/** 定系数气动孔口(AMESim PNOR001)。 */
export function AmesimPnor001Symbol() {
return (
);
}
/** PNVO001 convenience variant whose opening is fixed by a parameter. */
export function AmesimPnvo001FixedSymbol() {
return (
);
}
/** Signal-modulated pneumatic orifice (AMESim PNVO001 / pn_morifice). */
export function AmesimPnvo001SignalSymbol() {
return (
);
}
type PipeSection = "C" | "R";
const PIPE_NETWORK_CONTENT_CENTER = { x: 32, y: 24 } as const;
const PIPE_NETWORK_CONTENT_SCALE = 0.64;
const PIPE_NETWORK_CONTENT_TRANSFORM = `translate(${PIPE_NETWORK_CONTENT_CENTER.x} ${PIPE_NETWORK_CONTENT_CENTER.y}) scale(${PIPE_NETWORK_CONTENT_SCALE}) translate(${-PIPE_NETWORK_CONTENT_CENTER.x} ${-PIPE_NETWORK_CONTENT_CENTER.y})`;
function scaledPipeNetworkPoint(x: number, y: number) {
return {
x:
PIPE_NETWORK_CONTENT_CENTER.x +
(x - PIPE_NETWORK_CONTENT_CENTER.x) * PIPE_NETWORK_CONTENT_SCALE,
y:
PIPE_NETWORK_CONTENT_CENTER.y +
(y - PIPE_NETWORK_CONTENT_CENTER.y) * PIPE_NETWORK_CONTENT_SCALE,
};
}
export const PIPE_NETWORK_PORT_ANCHORS = {
left: scaledPipeNetworkPoint(2, 24),
right: scaledPipeNetworkPoint(62, 24),
} as const;
function PipeNetworkBody({ sections }: { sections: readonly PipeSection[] }) {
const left = 9;
const right = 55;
const top = 13;
const bottom = 35;
const sectionWidth = (right - left) / sections.length;
return (
{sections.slice(1).map((_, index) => {
const x = left + sectionWidth * (index + 1);
return (
);
})}
{sections.map((section, index) => (
{section}
))}
);
}
/** Pure pneumatic resistance line (AMESim PNL00R). */
export function AmesimPnl00rSymbol() {
return (
);
}
/** C-R dynamic pneumatic line (AMESim PNL0001): port 1 is R, port 2 is C. */
export function AmesimPnl0001Symbol() {
return (
);
}
/** R-C-R dynamic pneumatic line (AMESim PNL0002). */
export function AmesimPnl0002Symbol() {
return (
);
}
/** C-R-C dynamic pneumatic line (AMESim PNL0003). */
export function AmesimPnl0003Symbol() {
return (
);
}
const JUNCTION_STROKE = "#8b134f";
const JUNCTION_FINE_STROKE_WIDTH = 1.5;
const JUNCTION_COLLECTOR_STROKE_WIDTH = 4;
const JUNCTION_CENTER_RADIUS = 2.75;
export const PN3NODE2_PORT_ANCHORS = {
port1: { x: 36.6, y: 11.2 },
port2: { x: 24.6, y: 24 },
port3: { x: 36.6, y: 36.8 },
} as const;
export const P4NODE2_PORT_ANCHORS = {
port1: { x: 32, y: 11.2 },
port2: { x: 19.2, y: 24 },
port3: { x: 44.8, y: 24 },
port4: { x: 32, y: 36.8 },
} as const;
/** Three-port pneumatic junction with one inlet-side and two outlet-side ports. */
export function AmesimPn3Node2Symbol() {
return (
);
}
/** Four-port pneumatic junction with one inlet-side and three outlet-side ports. */
export function AmesimP4Node2Symbol() {
return (
);
}