This commit is contained in:
2025-05-07 23:42:54 +02:00
parent e49d0694b4
commit 86bae4f643
2 changed files with 11 additions and 6 deletions

View File

@@ -688,6 +688,7 @@ class EarthWorksTaskPanel:
land.trim(pts, 1)
tmp = []
shp = Part.Shape()
for face in sh.Faces:
wire = face.Wires[0].copy()
pl = wire.Placement.Base
@@ -697,8 +698,10 @@ class EarthWorksTaskPanel:
# Caso simple
wire = wire.makeOffset2D(10000, 0, False, False, True)
wire.Placement.Base.z = wire.Placement.Base.z - 10000
wire = wire.makeFillet(1, wire.Edges)
tmp.append(Part.makeLoft([face.Wires[0], wire], True, True, False))
top = wire.makeOffset2D(1, 0, False, False, True)
loft = Part.makeLoft([top, wire], True, True, False)
tmp.append(loft)
shp = shp.fuse(loft)
else:
# Caso complejo:
vertices = face.Vertexes
@@ -711,14 +714,16 @@ class EarthWorksTaskPanel:
for tri in triangles:
# Crear wire triangular
wire = Part.makePolygon([v.Point for v in tri] + [tri[0].Point])
# Hacer offset (ahora es coplanar por ser triángulo)
wire = wire.makeOffset2D(10000, 0, False, False, True)
wire.Placement.Base.z = wire.Placement.Base.z - 10000
wire = wire.makeFillet(1, wire.Edges)
tmp.append(Part.makeLoft([face.Wires[0], wire], True, True, False))
top = wire.makeOffset2D(1, 0, False, False, True)
loft = Part.makeLoft([top, wire], True, True, False)
tmp.append(loft)
shp = shp.fuse(loft)
final_tool = Part.makeCompound(tmp)
Part.show(final_tool, "tool")
Part.show(shp)
FreeCAD.ActiveDocument.commitTransaction()
self.closeForm()

View File

@@ -357,7 +357,7 @@ class OffsetArea(_Area):
import Utils.PVPlantUtils as utils
base = obj.Base.Shape
land = PVPlantSite.get().Terrain.mesh
land = PVPlantSite.get().Terrain.Mesh
vec = FreeCAD.Vector(0, 0, 1)
wire = utils.getProjected(base, vec)
wire = wire.makeOffset2D(obj.OffsetDistance.Value, 2, False, False, True)