In the following sections, you may see some properties or methods marked with
@ignore. This means that they are not part of the public API and you should ignore them.
import {CadData, CadLine, CadViewer} from "@lucilor/cad-viewer";
const line = new CadLine();
line.start.set(0, 0);
line.end.set(100, 100);
const data = new CadData();
data.entities.add(line);
const viewer = new CadViewer(data, {width: innerWidth, height: innerHeight});
viewer.appendTo(document.body);
await viewer.render();
viewer.center();
You can also create a CadData like this:
const json = new CadData().export();
const data = new CadData(json);
"white" , "#ffffff", "rgb(255, 255, 255)" , etc.stroke-dasharray , see more.[1, 2] for 1px padding at start and 2px at end; 3 for 3px padding at both start and end.CadViewerCadDataCadEntitiesColoredObject