Devesh36/clear-mouse

A transparent, right-handed wireless mouse assembly with a 44×58 mm control PCB, LiPo battery, optical sensor, click buttons, scroll encoder, DPI/middle buttons, USB‑C charging, and 3D‑printed housing/mechanical hardware.

Version
0.1.5
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone Devesh36/clear-mouse  # download the package files into ./clear-mouse
tsci add Devesh36/clear-mouse    # add it to your project as @tsci/Devesh36.clear-mouse

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

device-parts.tsx

import { jscad } from "tscircuit";
const gray = { color: "#8a9f99", roughness: 0.65 };
import { PixelText } from "./lettering";
import { Wire } from "./mechanics";
export function ScrollWheel() {
	return (
		<jscad.translate offset={[0, 30, 7.8]}>
			<jscad.union>
				<jscad.rotate rotation={[0, Math.PI / 2, 0]}>
					<jscad.cylinder
						radius={10.3}
						height={6}
						material={{ color: "#bdc7c9", metalness: 0.7, roughness: 0.28 }}
					/>
					<jscad.cylinder
						radius={1.45}
						height={10}
						center={[0, 0, 5]}
						material={{ color: "#b6bfc0", metalness: 0.7 }}
					/>
					<jscad.translate offset={[0, 0, -10]}>
						<jscad.extrudeLinear height={10}>
							<jscad.polygon
								points={Array.from(
									{ length: 6 },
									(_, i) =>
										[
											1.674 * Math.cos((i * Math.PI) / 3),
											1.674 * Math.sin((i * Math.PI) / 3),
										] as [number, number],
								)}
							/>
						</jscad.extrudeLinear>
					</jscad.translate>
				</jscad.rotate>
			</jscad.union>
		</jscad.translate>
	);
}

export function ScrollTire() {
	return (
		<jscad.material color="#252e36" roughness={0.92}>
			<jscad.translate offset={[0, 30, 7.8]}>
				<jscad.subtract>
					<jscad.union>
						<jscad.rotate rotation={[0, Math.PI / 2, 0]}>
							<jscad.cylinder radius={11.8} height={5.6} />
						</jscad.rotate>
						{Array.from({ length: 40 }, (_, i) => {
							const a = (i * Math.PI) / 20;
							return (
								<jscad.translate
									key={i}
									offset={[0, 11.75 * Math.cos(a), 11.75 * Math.sin(a)]}
								>
									<jscad.rotate rotation={[a, 0, 0]}>
										<jscad.roundedCuboid
											size={[5.4, 0.65, 0.5]}
											roundRadius={0.15}
										/>
									</jscad.rotate>
								</jscad.translate>
							);
						})}
					</jscad.union>
					<jscad.rotate rotation={[0, Math.PI / 2, 0]}>
						<jscad.cylinder radius={10.3} height={8} />
					</jscad.rotate>
				</jscad.subtract>
			</jscad.translate>
		</jscad.material>
	);
}

export function WheelBearing() {
	return (
		<jscad.material {...gray}>
			<jscad.subtract>
				<jscad.cuboid size={[3.5, 7, 9]} center={[8.5, 30, 5.3]} />
				<jscad.cylinder radius={0.8} height={4.5} center={[8.5, 30, 2.4]} />
				<jscad.translate offset={[8.5, 30, 7.8]}>
					<jscad.rotate rotation={[0, Math.PI / 2, 0]}>
						<jscad.cylinder radius={1.6} height={6} />
					</jscad.rotate>
				</jscad.translate>
			</jscad.subtract>
		</jscad.material>
	);
}

export function Feet() {
	return (
		<jscad.material color="#e5e9e7" roughness={0.5}>
			<jscad.union>
				{[-1, 1].map((i) => (
					<jscad.roundedCuboid
						key={i}
						size={[56, 7, 0.5]}
						roundRadius={0.24}
						center={[-4, i > 0 ? 45 : -48, -6.35]}
					/>
				))}
			</jscad.union>
		</jscad.material>
	);
}

export function LensEnvelope() {
	return (
		<jscad.material color="#161d20" roughness={0.5}>
			<jscad.subtract>
				<jscad.roundedCuboid
					size={[19, 12, 3.2]}
					roundRadius={0.7}
					center={[-3.519, 0, -2.6]}
				/>
				<jscad.cylinder radius={2.2} height={6} center={[-3.519, 0, -3]} />
				<jscad.cylinder radius={1.3} height={6} center={[1.5, 0, -3]} />
			</jscad.subtract>
		</jscad.material>
	);
}

export function BatteryFoil() {
	return (
		<jscad.roundedCuboid
			size={[11.5, 31, 3.8]}
			roundRadius={0.8}
			center={[0, -5, 11.4]}
			material={{ color: "#c7ced1", metalness: 0.6, roughness: 0.4 }}
		/>
	);
}

export function BatteryLabel() {
	return (
		<jscad.cuboid
			size={[9.5, 22, 0.15]}
			center={[0, -5, 13.37]}
			material={{ color: "#f1f2ec" }}
		/>
	);
}

export function BatteryPrint() {
	return (
		<jscad.colorize color="#526a68">
			<PixelText text="100mAh" x={-4.2} y={-2} z={13.47} pitch={0.23} />
		</jscad.colorize>
	);
}

export function BatteryTape() {
	return (
		<jscad.cuboid
			size={[11.5, 3, 3.85]}
			center={[0, 9, 11.4]}
			material={{ color: "#bd8b34", transparent: true, opacity: 0.7 }}
		/>
	);
}

export function RedWire() {
	return (
		<Wire
			color="#b33c34"
			points={[
				[3, 10.5, 11.4],
				[3, 15, 12],
				[10, 15, 11],
				[14, 14, 6],
				[14, 16.5, 3.8],
			]}
		/>
	);
}

export function BlackWire() {
	return (
		<Wire
			color="#25292b"
			points={[
				[4.5, 10.5, 11.4],
				[4.5, 14, 12],
				[10, 14, 10],
				[16, 14, 6],
				[16, 16.5, 3.8],
			]}
		/>
	);
}

export function NtcWire({ ground = false }: { ground?: boolean }) {
	return (
		<Wire
			color={ground ? "#383936" : "#d6a856"}
			points={[
				[4 + (ground ? 1 : 0), -5, 13.7],
				[8, -3 + (ground ? 1 : 0), 14],
				[14, 6 + (ground ? 1 : 0), 12],
				[ground ? 21.27 : 18.73, 8, 8.8],
			]}
		/>
	);
}

export function SensorPads() {
	return (
		<jscad.material color="#313e39" roughness={0.9}>
			<jscad.union>
				{[-4, 4].map((x) => (
					<jscad.cuboid key={x} size={[2, 3, 0.5]} center={[x, 0, 2.95]} />
				))}
			</jscad.union>
		</jscad.material>
	);
}

export function WheelScrew() {
	return (
		<jscad.material color="#b6bdc0" metalness={0.7}>
			<jscad.union>
				<jscad.cylinder radius={1} height={5} center={[8.5, 30, 1.7]} />
				<jscad.cylinder radius={2} height={1} center={[8.5, 30, -1.3]} />
			</jscad.union>
		</jscad.material>
	);
}

// A removable elastomer loop retains the cell without clamping the pouch flat.
export function BatteryBand() {
	return (
		<jscad.material color="#416f82" roughness={0.9}>
			<jscad.union>
				<jscad.roundedCuboid
					size={[18.4, 3, 0.8]}
					roundRadius={0.3}
					center={[0, -13, 14.5]}
				/>
				<jscad.cuboid size={[18.4, 3, 0.6]} center={[0, -13, 7.5]} />
				{[-8.8, 8.8].map((x) => (
					<jscad.cuboid key={x} size={[0.8, 3, 7.1]} center={[x, -13, 10.95]} />
				))}
			</jscad.union>
		</jscad.material>
	);
}