Skip to content
Permalink
Browse files

bug fix: spacing implemented in all rebar dialogs

  • Loading branch information...
amrit3701 committed Jul 11, 2017
1 parent bcc2ea7 commit 8a3672dc88deb395706773b8291e162b1a1e5f3d
Showing with 15 additions and 6 deletions.
  1. +5 −2 Stirrup.py
  2. +5 −2 StraightRebar.py
  3. +5 −2 UShapeRebar.py
@@ -30,6 +30,7 @@
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import FreeCADGui
import ArchCommands
import os
import sys
import math
@@ -196,8 +197,9 @@ def makeStirrup(s_cover, f_cover, bentAngle, bentFactor, diameter, rounding,\
if amount_spacing_check:
rebar = Arch.makeRebar(structure, line, diameter, amount_spacing_value, f_cover)
else:
size = (ArchCommands.projectToVector(structure.Shape.copy(), face.normalAt(0, 0))).Length
rebar = Arch.makeRebar(structure, line, diameter,\
int((StructurePRM[1] - diameter) / amount_spacing_value), f_cover)
int((size - diameter) / amount_spacing_value), f_cover)
rebar.Direction = FaceNormal.negative()
rebar.Rounding = rounding
# Adds properties to the rebar object
@@ -264,7 +266,8 @@ def editStirrup(Rebar, s_cover, f_cover, bentAngle, bentFactor, diameter, roundi
FreeCAD.ActiveDocument.recompute()
Rebar.AmountCheck = True
else:
Rebar.Amount = int((StructurePRM[1] - diameter) / amount_spacing_value)
size = (ArchCommands.projectToVector(structure.Shape.copy(), face.normalAt(0, 0))).Length
Rebar.Amount = int((size - diameter) / amount_spacing_value)
FreeCAD.ActiveDocument.recompute()
Rebar.AmountCheck = False
Rebar.FrontCover = f_cover
@@ -30,6 +30,7 @@
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import FreeCADGui
import ArchCommands
import os
import sys
import math
@@ -124,7 +125,8 @@ def makeStraightRebar(f_cover, b_cover, s_cover, diameter, amount_spacing_check,
rebar = Arch.makeRebar(structure, sketch, diameter, amount_spacing_value, f_cover)
FreeCAD.ActiveDocument.recompute()
else:
rebar = Arch.makeRebar(structure, sketch, diameter, int((StructurePRM[1] - diameter) / amount_spacing_value), f_cover)
size = (ArchCommands.projectToVector(structure.Shape.copy(), face.normalAt(0, 0))).Length
rebar = Arch.makeRebar(structure, sketch, diameter, int((size - diameter) / amount_spacing_value), f_cover)
# Adds properties to the rebar object
rebar.ViewObject.addProperty("App::PropertyString", "RebarShape", "RebarDialog", QT_TRANSLATE_NOOP("App::Property", "Shape of rebar")).RebarShape = "StraightRebar"
rebar.ViewObject.setEditorMode("RebarShape", 2)
@@ -174,7 +176,8 @@ def editStraightRebar(Rebar, f_cover, b_cover, s_cover, diameter, amount_spacing
FreeCAD.ActiveDocument.recompute()
Rebar.AmountCheck = True
else:
Rebar.Amount = int((StructurePRM[1] - diameter) / amount_spacing_value)
size = (ArchCommands.projectToVector(structure.Shape.copy(), face.normalAt(0, 0))).Length
Rebar.Amount = int((size - diameter) / amount_spacing_value)
FreeCAD.ActiveDocument.recompute()
Rebar.AmountCheck = False
Rebar.FrontCover = f_cover
@@ -30,6 +30,7 @@
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import FreeCADGui
import ArchCommands
import os
import sys
import math
@@ -135,7 +136,8 @@ def makeUShapeRebar(f_cover, b_cover, s_cover, diameter, t_cover, rounding, amou
rebar = Arch.makeRebar(structure, sketch, diameter, amount_spacing_value, f_cover)
FreeCAD.ActiveDocument.recompute()
else:
rebar = Arch.makeRebar(structure, sketch, diameter, int((StructurePRM[1] - diameter) / amount_spacing_value), f_cover)
size = (ArchCommands.projectToVector(structure.Shape.copy(), face.normalAt(0, 0))).Length
rebar = Arch.makeRebar(structure, sketch, diameter, int((size - diameter) / amount_spacing_value), f_cover)
rebar.Rounding = rounding
# Adds properties to the rebar object
rebar.ViewObject.addProperty("App::PropertyString", "RebarShape", "RebarDialog", QT_TRANSLATE_NOOP("App::Property", "Shape of rebar")).RebarShape = "UShapeRebar"
@@ -192,7 +194,8 @@ def editUShapeRebar(Rebar, f_cover, b_cover, s_cover, diameter, t_cover, roundin
FreeCAD.ActiveDocument.recompute()
Rebar.AmountCheck = True
else:
Rebar.Amount = int((StructurePRM[1] - diameter) / amount_spacing_value)
size = (ArchCommands.projectToVector(structure.Shape.copy(), face.normalAt(0, 0))).Length
Rebar.Amount = int((size - diameter) / amount_spacing_value)
FreeCAD.ActiveDocument.recompute()
Rebar.AmountCheck = False
Rebar.FrontCover = f_cover

0 comments on commit 8a3672d

Please sign in to comment.
You can’t perform that action at this time.