Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
feat: add B-Rep STEP import with exact round-trip
Import STEP/STP files as tessellated mesh bodies (Tier 1) while retaining each body's exact OpenCascade B-Rep, normalized to the body's local frame (lib/stepImport). On STEP export, re-emit imported bodies from that stored B-Rep with the editor's placement reapplied via rigid kernel ops: rigid and uniform-scaled placements stay exact analytic geometry, and non-uniform resize degrades to valid B-splines (Tier 2). Closes import -> edit -> export. A shared lazy occt-wasm loader (lib/brepKernel) is reused by import and export so the kernel loads at most once per session, on first use.
This commit is contained in:
@@ -6474,13 +6474,21 @@ export function SketchForgeEditor({
|
||||
}, [commitShapes, shapes]);
|
||||
|
||||
const selectFile = useCallback(async (file: File) => {
|
||||
if (!importExtensionSupported(file.name)) {
|
||||
setNotice("Unsupported file type. Use STL.");
|
||||
const isStep = /\.(step|stp)$/i.test(file.name);
|
||||
if (!isStep && !importExtensionSupported(file.name)) {
|
||||
setNotice("Unsupported file type. Use STL or STEP.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const nextShape = importedShapeFromStl(file.name, await file.arrayBuffer());
|
||||
let nextShape: WorkplaneShape;
|
||||
if (isStep) {
|
||||
setNotice("Reading STEP… first import loads the OpenCascade kernel (~22 MB), one time per session");
|
||||
const { importedShapeFromStep } = await import("@/lib/stepImport");
|
||||
nextShape = await importedShapeFromStep(file.name, await file.arrayBuffer());
|
||||
} else {
|
||||
nextShape = importedShapeFromStl(file.name, await file.arrayBuffer());
|
||||
}
|
||||
commitShapes([...shapes, nextShape], nextShape.id, `Imported ${file.name}`);
|
||||
setTopPanel(null);
|
||||
} catch (error) {
|
||||
@@ -6954,7 +6962,7 @@ export function SketchForgeEditor({
|
||||
ref={fileInputRef}
|
||||
className="hidden-file-input"
|
||||
type="file"
|
||||
accept=".stl"
|
||||
accept=".stl,.step,.stp"
|
||||
onChange={(event) => {
|
||||
if (event.currentTarget.files) {
|
||||
selectFiles(event.currentTarget.files);
|
||||
@@ -7441,7 +7449,7 @@ function TopActionPanel({
|
||||
}}
|
||||
>
|
||||
<ToolbarImportIcon />
|
||||
<strong>Drop STL files</strong>
|
||||
<strong>Drop STL or STEP files</strong>
|
||||
<span>or click to choose from your computer</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user