diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4a330d9..14ac850a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,55 +6,6 @@ on: workflow_dispatch: jobs: - build-flatpak: - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install flatpak and flatpak-builder - run: | - sudo apt-get update -q - sudo apt-get install -y flatpak flatpak-builder - - - name: Add Flathub remote - run: | - flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - - - name: Install runtimes - run: | - flatpak install -y --user \ - org.freedesktop.Platform//24.08 \ - org.freedesktop.Sdk//24.08 \ - org.freedesktop.Sdk.Extension.rust-stable//24.08 - - - name: Generate cargo-sources.json - run: | - pip3 install tomlkit aiohttp - git clone --depth=1 https://github.com/flatpak/flatpak-builder-tools.git /tmp/flatpak-builder-tools - python3 /tmp/flatpak-builder-tools/cargo/flatpak-cargo-generator.py \ - Cargo.lock -o flatpak/cargo-sources.json - - - name: Build Flatpak - run: | - flatpak-builder --force-clean --user --repo=repo build-dir \ - flatpak/io.github.HakanSeven12.H7CAD.ci.yml - - - name: Create bundle - run: | - flatpak build-bundle repo H7CAD.flatpak io.github.HakanSeven12.H7CAD - - - name: Upload bundle to release - if: github.event_name == 'release' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - mv H7CAD.flatpak H7CAD-${{ github.ref_name }}-linux-x86_64.flatpak - gh release upload ${{ github.ref_name }} H7CAD-${{ github.ref_name }}-linux-x86_64.flatpak --clobber --repo ${{ github.repository }} - build-appimage: runs-on: ubuntu-22.04 permissions: @@ -84,7 +35,7 @@ jobs: mkdir -p AppDir/usr/share/applications mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps cp target/release/H7CAD AppDir/usr/bin/H7CAD - cp flatpak/io.github.HakanSeven12.H7CAD.desktop AppDir/usr/share/applications/ + cp packaging/H7CAD.desktop AppDir/usr/share/applications/io.github.HakanSeven12.H7CAD.desktop rsvg-convert -w 256 -h 256 assets/logo.svg \ -o AppDir/usr/share/icons/hicolor/256x256/apps/io.github.HakanSeven12.H7CAD.png @@ -99,7 +50,7 @@ jobs: run: | ./linuxdeploy-x86_64.AppImage \ --appdir AppDir \ - --desktop-file flatpak/io.github.HakanSeven12.H7CAD.desktop \ + --desktop-file AppDir/usr/share/applications/io.github.HakanSeven12.H7CAD.desktop \ --icon-file AppDir/usr/share/icons/hicolor/256x256/apps/io.github.HakanSeven12.H7CAD.png \ --output appimage mv H7CAD*.AppImage H7CAD.AppImage @@ -134,3 +85,79 @@ jobs: run: | mv target/release/H7CAD.exe H7CAD-${{ github.ref_name }}-windows-x86_64.exe gh release upload ${{ github.ref_name }} H7CAD-${{ github.ref_name }}-windows-x86_64.exe --clobber --repo ${{ github.repository }} + + build-macos: + strategy: + fail-fast: false + matrix: + include: + - runner: macos-14 # Apple Silicon (arm64) + target: aarch64-apple-darwin + arch: arm64 + - runner: macos-13 # Intel (x86_64) + target: x86_64-apple-darwin + arch: x86_64 + runs-on: ${{ matrix.runner }} + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Install librsvg (for rsvg-convert) + env: + HOMEBREW_NO_AUTO_UPDATE: "1" + run: brew install librsvg + + - name: Build + run: cargo build --release --target ${{ matrix.target }} + + - name: Build .icns from SVG + run: | + mkdir -p H7CAD.iconset + # Render all the sizes Apple expects in an .icns. + for SIZE in 16 32 64 128 256 512 1024; do + rsvg-convert -w $SIZE -h $SIZE assets/logo.svg -o H7CAD.iconset/icon_${SIZE}x${SIZE}.png + done + # @2x retina variants (half-size base name) + for BASE in 16 32 128 256 512; do + DOUBLE=$((BASE * 2)) + cp H7CAD.iconset/icon_${DOUBLE}x${DOUBLE}.png H7CAD.iconset/icon_${BASE}x${BASE}@2x.png + done + iconutil -c icns H7CAD.iconset -o AppIcon.icns + + - name: Assemble .app bundle + run: | + APP=H7CAD.app + rm -rf "$APP" + mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" + cp target/${{ matrix.target }}/release/H7CAD "$APP/Contents/MacOS/H7CAD" + chmod +x "$APP/Contents/MacOS/H7CAD" + cp AppIcon.icns "$APP/Contents/Resources/AppIcon.icns" + # Substitute version into Info.plist. + VERSION="${{ github.ref_name }}" + VERSION="${VERSION#v}" + [ -z "$VERSION" ] && VERSION="0.0.0" + sed "s/__VERSION__/$VERSION/g" packaging/Info.plist > "$APP/Contents/Info.plist" + + - name: Create .dmg + run: | + hdiutil create \ + -volname "H7CAD" \ + -srcfolder H7CAD.app \ + -ov -format UDZO \ + H7CAD.dmg + + - name: Upload .dmg to release + if: github.event_name == 'release' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mv H7CAD.dmg H7CAD-${{ github.ref_name }}-macos-${{ matrix.arch }}.dmg + gh release upload ${{ github.ref_name }} H7CAD-${{ github.ref_name }}-macos-${{ matrix.arch }}.dmg --clobber --repo ${{ github.repository }} diff --git a/Cargo.lock b/Cargo.lock index 96726681..8d1326ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "H7CAD" -version = "0.3.4" +version = "0.3.5" dependencies = [ "acadrust", "bytemuck", diff --git a/Cargo.toml b/Cargo.toml index b7d3c133..8a9b3a40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "H7CAD" -version = "0.3.4" +version = "0.3.5" edition = "2021" build = "build.rs" diff --git a/README.md b/README.md index a62c7509..4ea4588e 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,16 @@ No installation required — runs directly on any modern Linux distribution. ### Windows -Download `H7CAD.exe` from the [latest release](https://github.com/HakanSeven12/H7CAD/releases/latest) and run it directly. +Download `H7CAD-*-windows-x86_64.exe` from the [latest release](https://github.com/HakanSeven12/H7CAD/releases/latest) and run it directly. Windows SmartScreen may show "Windows protected your PC" because the binary is not yet code-signed — click **More info → Run anyway**. + +### macOS + +Download the matching `.dmg` from the [latest release](https://github.com/HakanSeven12/H7CAD/releases/latest): + +- Apple Silicon: `H7CAD-*-macos-arm64.dmg` +- Intel: `H7CAD-*-macos-x86_64.dmg` + +Open the .dmg and drag `H7CAD.app` to `/Applications`. The first launch may be blocked by Gatekeeper because the app is not notarised — right-click `H7CAD.app → Open` and confirm, or run once via `xattr -dr com.apple.quarantine /Applications/H7CAD.app`. ### Build from Source diff --git a/flatpak/io.github.HakanSeven12.H7CAD.ci.yml b/flatpak/io.github.HakanSeven12.H7CAD.ci.yml deleted file mode 100644 index fb14676b..00000000 --- a/flatpak/io.github.HakanSeven12.H7CAD.ci.yml +++ /dev/null @@ -1,33 +0,0 @@ -app-id: io.github.HakanSeven12.H7CAD -runtime: org.freedesktop.Platform -runtime-version: '24.08' -sdk: org.freedesktop.Sdk -sdk-extensions: - - org.freedesktop.Sdk.Extension.rust-stable -command: H7CAD - -finish-args: - - --device=dri - - --socket=wayland - - --socket=fallback-x11 - - --share=ipc - -build-options: - append-path: /usr/lib/sdk/rust-stable/bin - env: - CARGO_HOME: /run/build/H7CAD/cargo - -modules: - - name: H7CAD - buildsystem: simple - build-commands: - - cargo --offline fetch --manifest-path Cargo.toml --verbose - - cargo --offline build --release --verbose - - install -Dm755 target/release/H7CAD /app/bin/H7CAD - - install -Dm644 assets/logo.svg /app/share/icons/hicolor/scalable/apps/io.github.HakanSeven12.H7CAD.svg - - install -Dm644 flatpak/io.github.HakanSeven12.H7CAD.desktop /app/share/applications/io.github.HakanSeven12.H7CAD.desktop - - install -Dm644 flatpak/io.github.HakanSeven12.H7CAD.metainfo.xml /app/share/metainfo/io.github.HakanSeven12.H7CAD.metainfo.xml - sources: - - type: dir - path: .. - - cargo-sources.json diff --git a/flatpak/io.github.HakanSeven12.H7CAD.metainfo.xml b/flatpak/io.github.HakanSeven12.H7CAD.metainfo.xml deleted file mode 100644 index 658e8d4f..00000000 --- a/flatpak/io.github.HakanSeven12.H7CAD.metainfo.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - io.github.HakanSeven12.H7CAD - - H7CAD - A CAD application for 2D/3D drawing and design - - MIT - GPL-3.0-only - - -

- H7CAD is a computer-aided design (CAD) application built with Rust. - It supports 2D drafting and 3D modeling with GPU-accelerated rendering, - and can open and work with DXF files. -

- -
- - io.github.HakanSeven12.H7CAD.desktop - - https://github.com/HakanSeven12/H7CAD - https://github.com/HakanSeven12/H7CAD/issues - https://github.com/HakanSeven12/H7CAD - - - - Main application window - https://github.com/user-attachments/assets/25bc2bb2-c35c-477d-a3e9-45c86690b5c9 - - - - - - -
    -
  • Fixed hatch boundaries with spline edges rendering hollow — DXF rational/NURBS spline weights are now honored and the curve is sampled adaptively instead of at a fixed 16 segments.
  • -
  • Fixed hatch boundary precision: polyline-bulge arc tessellation now runs in f64, so hatch edges on large (UTM-scale) drawings no longer appear wavy / jagged.
  • -
  • Fixed hatch pattern stripes mis-aligning between adjacent hatches by snapping each hatch's anchor to the family's perp/along grid in f64.
  • -
  • Fixed wrong hatch being selected on click: the point-in-polygon test now correctly handles NaN path separators in multi-path (island / hole) boundaries.
  • -
  • Clicking a hatch inside a block now selects the parent Insert, matching AutoCAD's block sub-entity behaviour.
  • -
  • Hatch boundary outlines also tessellate polyline bulges as arcs in the wire pass (was drawing straight chords), and arc segments adapt to the current zoom level.
  • -
  • Cleanup: dropped the INSERT_SUB_LIMIT fallback guard, removed several dead UI helpers / scene utilities / orphan toolbar stubs, and shortened stale legacy comments.
  • -
-
-
- - -
    -
  • Fixed major precision loss on UTM-authored drawings: world_offset now derives from the median of MSPACE entity centroids instead of the DXF $EXTMIN/$EXTMAX midpoint, so a single stray entity can no longer drag the offset hundreds of kilometres away from the real geometry (about 120× better precision on the affected files).
  • -
  • Fixed Zoom Extents collapsing the drawing to sub-pixel size on files with orphan or block-defn entities leaking into model space.
  • -
  • Fixed phantom selectable segments from BLOCK / ENDBLK sentinels showing up far from the visible drawing.
  • -
  • Fixed two text rendering bugs: greek (sub-pixel) rectangle now fills at the text's own color, and the rectangle honours word-wrapped sub-line count.
  • -
  • Performance: multi-resolution mesh LOD for 3D solids — the render pipeline now picks one of three pre-built tessellation densities per frame based on projected pixel size.
  • -
  • Performance: hatch LOD substitutes solid fill when pattern spacing falls below ~2 px, and skips draw calls entirely when the whole hatch projects to sub-pixel size.
  • -
  • Performance: zoom-adaptive curve tolerance for top-level wires — distant arcs no longer emit hundreds of segments that all collapse onto one pixel.
  • -
  • Performance: text LOD ladder (baseline-line / greek / full) now also applies to MultiLeader text content.
  • -
  • Performance: paper-space viewport scissor extended to hatch / image / wipeout passes (in addition to the existing wire scissor).
  • -
-
-
- - -
    -
  • Fixed creating a new drawing so existing open files remain in their tabs.
  • -
  • Fixed arc creation to preserve clicked positions and keep internal arc angles in radians.
  • -
  • Improved OCS/WCS handling, snap points, hatch boundary rendering, and thickness extrusion support.
  • -
-
-
- - -

Initial release of H7CAD.

-
-
-
- - - - - Hakan Seven - -
diff --git a/flatpak/io.github.HakanSeven12.H7CAD.yml b/flatpak/io.github.HakanSeven12.H7CAD.yml deleted file mode 100644 index af6cf5da..00000000 --- a/flatpak/io.github.HakanSeven12.H7CAD.yml +++ /dev/null @@ -1,35 +0,0 @@ -app-id: io.github.HakanSeven12.H7CAD -runtime: org.freedesktop.Platform -runtime-version: '24.08' -sdk: org.freedesktop.Sdk -sdk-extensions: - - org.freedesktop.Sdk.Extension.rust-stable -command: H7CAD - -finish-args: - - --device=dri - - --socket=wayland - - --socket=fallback-x11 - - --share=ipc - -build-options: - append-path: /usr/lib/sdk/rust-stable/bin - env: - CARGO_HOME: /run/build/H7CAD/cargo - -modules: - - name: H7CAD - buildsystem: simple - build-commands: - - cargo --offline fetch --manifest-path Cargo.toml --verbose - - cargo --offline build --release --verbose - - install -Dm755 target/release/H7CAD /app/bin/H7CAD - - install -Dm644 assets/logo.svg /app/share/icons/hicolor/scalable/apps/io.github.HakanSeven12.H7CAD.svg - - install -Dm644 flatpak/io.github.HakanSeven12.H7CAD.desktop /app/share/applications/io.github.HakanSeven12.H7CAD.desktop - - install -Dm644 flatpak/io.github.HakanSeven12.H7CAD.metainfo.xml /app/share/metainfo/io.github.HakanSeven12.H7CAD.metainfo.xml - sources: - - type: git - url: https://github.com/HakanSeven12/H7CAD.git - tag: v0.1.0 - commit: ff84a5e197ecf264f5e4e159173b157f97bcb7ce - - cargo-sources.json diff --git a/flatpak/io.github.HakanSeven12.H7CAD.desktop b/packaging/H7CAD.desktop similarity index 100% rename from flatpak/io.github.HakanSeven12.H7CAD.desktop rename to packaging/H7CAD.desktop diff --git a/packaging/Info.plist b/packaging/Info.plist new file mode 100644 index 00000000..bfd271df --- /dev/null +++ b/packaging/Info.plist @@ -0,0 +1,59 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + H7CAD + CFBundleExecutable + H7CAD + CFBundleIconFile + AppIcon + CFBundleIdentifier + io.github.HakanSeven12.H7CAD + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + H7CAD + CFBundlePackageType + APPL + CFBundleShortVersionString + __VERSION__ + CFBundleVersion + __VERSION__ + LSMinimumSystemVersion + 11.0 + NSHighResolutionCapable + + NSHumanReadableCopyright + © Hakan Seven + CFBundleDocumentTypes + + + CFBundleTypeName + AutoCAD Drawing + CFBundleTypeRole + Editor + LSItemContentTypes + + com.autodesk.dwg + + LSHandlerRank + Alternate + + + CFBundleTypeName + AutoCAD DXF + CFBundleTypeRole + Editor + LSItemContentTypes + + com.autodesk.dxf + + LSHandlerRank + Alternate + + + + diff --git a/src/main.rs b/src/main.rs index 8913fb10..423b97df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,8 @@ #![allow(non_snake_case)] +// On Windows release builds, hide the console window the OS would +// otherwise spawn alongside the GUI. Debug builds keep stdout/stderr +// attached so eprintln! / panics stay visible while developing. +#![cfg_attr(all(windows, not(debug_assertions)), windows_subsystem = "windows")] mod app; mod command;