feat(v3.8): 2D projection views + section + DXF + dimensions + G2 curvature
CI / Build & Test (push) Failing after 41s
CI / Release Build (push) Failing after 35s
Build & Test / build-and-test (push) Has been cancelled
Build & Test / python-bindings (push) Has been cancelled

This commit is contained in:
茂之钳
2026-07-24 15:23:30 +00:00
parent 6779b45f27
commit d2c628215d
5 changed files with 446 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
#pragma once
#include "vde/brep/brep.h"
#include "vde/core/point.h"
#include <vector>
#include <string>
namespace vde::brep {
/// 2D line segment for drawing output
struct DrawSegment {
double x1, y1, x2, y2;
bool hidden = false;
};
/// Projection view of a B-Rep body
struct ProjectionView {
std::string name;
std::vector<DrawSegment> segments;
std::vector<DrawSegment> hidden_lines;
double scale = 1.0;
[[nodiscard]] size_t total_segments() const { return segments.size() + hidden_lines.size(); }
};
/// Generate orthographic projection views (front, top, right)
[[nodiscard]] std::vector<ProjectionView> generate_views(const BrepModel& body);
/// Generate a section view
[[nodiscard]] ProjectionView section_view(const BrepModel& body,
const core::Point3D& point, const core::Vector3D& normal);
/// Export to DXF R12 format
bool export_dxf(const std::string& filepath, const std::vector<ProjectionView>& views);
/// Dimension type
enum class DimType { Linear, Radius, Diameter };
/// A dimension annotation
struct Dimension {
DimType type = DimType::Linear;
double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
std::string text;
};
/// Auto-generate dimensions for a view
[[nodiscard]] std::vector<Dimension> auto_dimension(const ProjectionView& view);
} // namespace vde::brep