import { Canvas, useLoader, useFrame } from '@react-three/fiber' import { Suspense } from 'react' import { Html, Stats } from '@react-three/drei' import CadPackage, { CadPackageType, } from 'src/components/CadPackage/CadPackage' import { navigate, routes, Link } from '@redwoodjs/router' import { useInView } from 'react-intersection-observer' import Svg, { SvgNames } from 'src/components/Svg/Svg' import Gravatar from 'src/components/Gravatar/Gravatar' import ProjectsCell from 'src/components/ProjectsCell' import OutBound from 'src/components/OutBound/OutBound' // dynamic import to enable pre-render iof the homepage const AssetWithGooey = React.lazy( () => import('src/components/Hero/AssetWithGooey') ) const cqCode = `from cadquery import * d1 = 58.5 d2 = 56.5 d3 = 63.5 d4 = 84 d5 = 88 h1 = 8.5 h2 = 154 l1 = 14.5 l2 = 4.5 cup = ( Workplane("XY").circle(d1 / 2).extrude(h1) .faces(">Z").circle(d3 / 2) .workplane(offset=h2).circle(d5 / 2) .loft() .cut(Workplane("XY") .circle((d3 - 3.5) / 2) .workplane(offset=h2).circle((d5 - 3.5) / 2) .loft() .translate([0, 0, h1]) ) `.split('\n') const scadCode = `hingeHalfExtrudeLength=hingeLength/2-clearance/2; mountingHoleMoveIncrement=(hingeLength-2*mountingHoleEdgeOffset)/ (mountingHoleCount-1); module costomizerEnd() {} $fn=30; tiny=0.005; // modules module hingeBaseProfile() { translate([pivotRadius,0,0]){ square([baseWidth,baseThickness]); } } module hingeBodyHalf() { difference() { union() { linear_extrude(hingeHalfExtrudeLength){ offset(1)offset(-2)offset(1){ translate([0,pivotRadius,0]){ circle(pivotRadius); } square([pivotRadius,pivotRadius]); hingeBaseProfile(); } } linear_extrude(hingeLength){ offset(1)offset(-1)hingeBaseProfile(); } } plateHoles(); } }`.split('\n') export const Hero = () => { return (
{cqCode.map((line, index) => (
{index + 1}
{line}
))}
{scadCode.map((line, index) => (
{index + 1}
{line}
))}
We want you to learn Code-CAD today so it can change the way you work tomorrow. Our community is writing tutorials to make this powerful paradigm more accessible to people new to code and CAD.
CadHub is the place you can try out Code-CAD packages to find the one that's right for you. Our dedicated community is making CAD easy to learn on the web. Try one of our three integrations today and keep an eye out for more.
{desc}
CadHub is a social platform. You can ask users how they designed a part, fork their work to put your own spin on it, and find inspiration in abundance.
{desc}
Built by{' '}