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-pr-30761-toggle-sync.patch
Created June 13, 2026 10:11
FreeCAD PR 30761 ToggleConstruction edit-mode sync patch
diff --git a/src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp b/src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp
index 9cdfa61031..7c86e6f85e 100644
--- a/src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp
+++ b/src/Mod/Sketcher/Gui/CommandAlterGeometry.cpp
@@ -31,6 +31,7 @@
#include <Gui/Notifications.h>
#include <Gui/Selection/Selection.h>
#include <Gui/Selection/SelectionObject.h>
+#include <Gui/ViewProviderDocumentObject.h>
#include <Mod/Sketcher/App/SketchObject.h>
@tritao
tritao / freecad-pr-30711-review.md
Created June 11, 2026 12:07
FreeCAD PR #30711 review findings

FreeCAD PR #30711 Review Findings

Reviewed PR: FreeCAD/FreeCAD#30711 Head reviewed: 525d3586f5

High - src/Gui/TaskView/TaskView.cpp:728

showDialog() re-adds an existing taskPanel to the QStackedWidget. Qt moves the widget, but taskInfos order stays unchanged, so vector index and stack index can diverge and show the wrong document's task panel.

High - src/Gui/TaskView/TaskView.cpp:554

@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;
}