Skip to content

Instantly share code, notes, and snippets.

View tritao's full-sized avatar
🎯
Focusing

João Matos tritao

🎯
Focusing
  • Portugal
View GitHub Profile
@tritao
tritao / freecad-core-clipping-plane-v1-plan.md
Last active May 11, 2026 16:10
FreeCAD core clipping plane + saved view proposal

FreeCAD Core Clipping Plane + Saved View Proposal

Status: draft for maintainer review

Summary

This proposal recommends two core document objects:

  • App::ClippingPlane as the reusable spatial clipping primitive
  • App::SavedView as the higher-level persisted view-state object
@tritao
tritao / pr-27849-review-fix.diff
Created April 26, 2026 11:34
Potential fix for FreeCAD/FreeCAD PR #27849 review findings (based on ac7fe6220f)
diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp
--- a/src/Mod/Import/Gui/AppImportGuiPy.cpp
+++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp
@@ -61,8 +61,6 @@
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
-#include <Gui/View3DInventor.h>
-#include <Gui/View3DInventorViewer.h>
#include <Gui/ViewProviderLink.h>
- Baseline behavior: a model with adjacent equal planar faces, cylindrical faces, and BSpline faces should refine to the same result as before the PR.
- No false negatives: equal faces must still merge when their geometric values sit near quantization/grid boundaries.
- No false positives: faces with the same structural hash/grid key but different actual geometry must not be merged.
- Mixed bucket case: multiple BSpline faces in the same or neighboring grid cells, where only some are equal, should produce the right equality groups.
- Plane/cylinder fallback: confirm planes and cylinders still use the old behavior effectively, since their structural hash/grid key now does not optimize them.
- Performance regression/sanity case: a shape with many same-type faces, especially many BSpline faces, should run faster or at least not worse than the old pairwise path.
@tritao
tritao / freecad-self-merge.py
Created January 25, 2026 11:41
FreeCAD self-merge stats (last 2 years) via GitHub GraphQL
#!/usr/bin/env python3
import csv
import json
import subprocess
import sys
from dataclasses import dataclass
from datetime import datetime, timezone
from typing import Any, Dict, Iterable, List, Optional, Tuple
OWNER = "FreeCAD"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using CppSharp;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors.Infrastructure;
using Microsoft.AspNetCore.Http;
const Button = defineComponent(({
id,
label = '',
width = 100,
height = 40,
color = gray,
hoverColor = lightGray,
pressedColor = darkGray,
fontSize = 16,
textColor = black,
#include <string>
#include <cctype>
#include <stdexcept>
#include <unordered_map>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <algorithm>
// Simple RGB color
static PyObject* createMyConstantsEnum()
{
// Import the Python 'enum' module.
PyObject* enumModule = PyImport_ImportModule("enum");
if (!enumModule) {
PyErr_SetString(PyExc_ImportError, "Failed to import the enum module");
return nullptr;
}
@tritao
tritao / py.cpp
Last active March 2, 2025 23:01
#include <Python.h>
#include <thread>
#include <future>
#include <iostream>
#include <chrono>
// ----- Python-bound Function: execute -----
//
// This function takes an integer, offloads a computation (here, squaring the number)
// using std::async, and returns the result.
FEP00
Title Evolution of FreeCAD's Rendering Subsystem
Status Draft
Author(s) Joao Matos (tritao)
Created Mar 02, 2025
Updated Mar 02, 2025