Fixed it so it mostly compiles yey me

This commit is contained in:
Gregory Kenneth Bowne 2024-02-14 21:36:58 -08:00
parent 9c06bf45bf
commit f78f69f579
11 changed files with 176 additions and 29 deletions

BIN
.vscode/browse.vc.db vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,6 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
add_compile_options(-g -Wall -Wextra -Werror -pedantic) add_compile_options(-g -Wall -Wextra -Werror -pedantic)

View File

@ -18,8 +18,22 @@ Calculating bend deduction involves several factors:
Bend Angle (α): The angle at which the sheet metal is bent. Bend Angle (α): The angle at which the sheet metal is bent.
Inside Radius (R): The radius of the bend where the material is not deformed. Inside Radius (R): The radius of the bend where the material is not deformed.
Material Thickness (T): The thickness of the sheet metal being bent. Material Thickness (T): The thickness of the sheet metal being bent.
K-factor (K): A value representing the position of the neutral axis relative to the material thickness. It varies based on the material properties and the bending radius 2. K-factor (K): A value representing the position of the neutral axis relative to the material thickness. It varies based on the material properties and the bending radius
The K-factor is used to calculate the bend allowance and is also relevant when calculating bend deduction. It helps determine the length of the metal plate stretched during the bending process and is a fundamental value for determining the bending allowance and bending deduction The K-factor is used to calculate the bend allowance and is also relevant when calculating bend deduction. It helps determine the length of the metal plate stretched during the bending process and is a fundamental value for determining the bending allowance and bending deduction
Additionally, when calculating bend deduction, it's important to note that the neutral axis shifts towards the inside surface of the bend during the bending process. This shift, combined with the material's properties and the bending radius, affects the amount of elongation that occurs during bending, which is taken into account when calculating bend deduction Additionally, when calculating bend deduction, it's important to note that the neutral axis shifts towards the inside surface of the bend during the bending process. This shift, combined with the material's properties and the bending radius, affects the amount of elongation that occurs during bending, which is taken into account when calculating bend deduction
Bend deduction is a crucial concept in sheet metal fabrication, allowing for accurate prediction of the final size of a part after bending. It accounts for the material's stretch and compression during the bending process. The formula provided for calculating bend deduction is not standard and seems to be a misunderstanding. Instead, bend deduction is typically calculated using the bend allowance and the outside setback (OSSB). The correct approach involves understanding several key factors:
Bend Angle (θθ): The angle to which the metal is bent.
Inside Radius (R): The radius on the inside of the bend, where the material undergoes compression.
Material Thickness (T): The thickness of the sheet metal being bent.
K-Factor (K): A coefficient that represents the location of the neutral axis (the layer within the material that does not experience tension or compression during bending) relative to the thickness of the material. This factor varies based on material properties and bending operations.
The bend deduction (BD) can be calculated using the formula: BD=2×OSSBBABD=2×OSSBBA where:
OSSB (Outside Setback) is calculated based on the material thickness, inside radius, and bend angle.
Bend Allowance (BA) is the arc length of the bend along the neutral axis. It accounts for the material stretch in the bending area and is calculated using the formula that incorporates the K-factor, bend angle, inside radius, and material thickness.
The K-factor is instrumental in determining the bend allowance and, subsequently, the bend deduction. It influences how the neutral axis shifts during bending, affecting the material's elongation and the final dimensions of the bent part.

33
docs/Setback.md Normal file
View File

@ -0,0 +1,33 @@
In the context of sheet metal forming and pressing, setback refers to the distance between the edge of the sheet and the tangent point of the bend radius. There are two types of setback: inside setback and outside setback.
The factors involved in calculating setback include:
- Bend Angle (α): The angle at which the sheet metal is bent. Changes in the bend angle will affect the setback
- Inside Radius (R): The radius of the bend where the material is not deformed. The setback is affected by changes in the inside radius
- Sheet Thickness (T): The thickness of the sheet metal being bent. Sheet thickness contributes to the overall setback
For outside setback, which is the distance from the tangent point of the radius to the outside bend vertex of the flange, the formula is as follows:
[ Outside \space Setback = T + \sqrt{R^2 - \left(\frac{T}{\sin(\alpha)}\right)^2} ]
The above formula assumes that the bend angle is less than 90 degrees. For a 90-degree bend angle, the setback value is simply the bend radius plus the sheet thickness
By knowing the values of outside setback and bend deduction, we can obtain the bend allowance. The sum of bend deduction and bend allowance is equal to two times the outside setback
Setback is a term used in sheet metal forming to describe the distance from the edge of the sheet to the tangent point of the bend radius. There are two types of setback: inside setback (ISSB) and outside setback (OSSB). These are important for calculating the flat pattern layout of a part before bending.
Inside Setback (ISSB)
Inside setback is the distance from the inside surface of the sheet metal to the tangent point of the bend radius. It is a measure of how much the material compresses on the inside of the bend.
Outside Setback (OSSB)
Outside setback is the distance from the tangent point of the bend radius to the outside bend vertex of the flange. It is a measure of how much the material stretches on the outside of the bend.
Factors Affecting Setback Calculation
Bend Angle (αα): The angle to which the metal is bent. The bend angle affects the setback because it changes the arc length of the bend.
Inside Radius (R): The radius of the bend on the inside of the material. The inside radius affects the setback because it determines how much the material compresses.
Sheet Thickness (T): The thickness of the sheet metal being bent. The thickness contributes to the overall setback because it affects the position of the neutral axis.
Calculating Outside Setback
For outside setback, the formula is: Outside Setback=T+R2(Tsin(α))2Outside Setback=T+R2(sin(α)T)2
This formula assumes that the bend angle is less than 90 degrees. For a 90-degree bend angle, the setback value is simply the bend radius plus the sheet thickness.
Relationship Between Setback, Bend Deduction, and Bend Allowance
The bend deduction (BD) and bend allowance (BA) are related to the setbacks. The bend deduction is the amount of material that must be subtracted from the total length of the flat pattern to achieve the correct size after bending. The bend allowance is the length of the neutral axis through the bend. The sum of the bend deduction and bend allowance is equal to two times the outside setback: BD+BA=2×OSSBBD+BA=2×OSSB

16
include/BendDeduction.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef BENDDUCTION_H
#define BENDDUCTION_H
class BendDeduction {
private:
double bendAngleRadians; // Bend angle in radians
double insideRadius; // Inside radius of the bend
double materialThickness; // Thickness of the material
double kFactor; // K-factor
public:
BendDeduction(double angleDegrees, double radius, double thickness, double k);
double calculateBendDeduction();
};
#endif

View File

@ -1,4 +1,29 @@
/* #ifndef FORMINGTOOL_H
* #define FORMINGTOOL_H
*
*/ #include <string>
#include <ostream>
#include <iostream>
class FormingTool {
public:
FormingTool(const std::string &toolType, double toolSize, const std::string &materialType);
std::string getToolType() const;
double getToolSize() const;
std::string getMaterialType() const;
double getToolRadius() const;
void setToolType(const std::string &toolType);
void setToolSize(double toolSize);
void setMaterialType(const std::string &materialType);
void setToolRadius(double radius);
void serialize(std::ofstream &ofs) const;
void deserialize(std::ifstream &ifs);
private:
std::string m_toolType;
double m_toolSize;
std::string m_materialType;
double m_toolRadius;
};
#endif // FORMINGTOOL_H

View File

@ -1,15 +0,0 @@
In the context of sheet metal forming and pressing, setback refers to the distance between the edge of the sheet and the tangent point of the bend radius. There are two types of setback: inside setback and outside setback.
The factors involved in calculating setback include:
- Bend Angle (α): The angle at which the sheet metal is bent. Changes in the bend angle will affect the setback
- Inside Radius (R): The radius of the bend where the material is not deformed. The setback is affected by changes in the inside radius
- Sheet Thickness (T): The thickness of the sheet metal being bent. Sheet thickness contributes to the overall setback
For outside setback, which is the distance from the tangent point of the radius to the outside bend vertex of the flange, the formula is as follows:
[ Outside \space Setback = T + \sqrt{R^2 - \left(\frac{T}{\sin(\alpha)}\right)^2} ]
The above formula assumes that the bend angle is less than 90 degrees. For a 90-degree bend angle, the setback value is simply the bend radius plus the sheet thickness
By knowing the values of outside setback and bend deduction, we can obtain the bend allowance. The sum of bend deduction and bend allowance is equal to two times the outside setback

View File

@ -0,0 +1,25 @@
#include <cmath>
class BendDeduction {
private:
double bendAngleRadians; // Bend angle in radians
double insideRadius; // Inside radius of the bend
double materialThickness; // Thickness of the material
double kFactor; // K-factor
public:
// Constructor to initialize the properties
BendDeduction(double angleDegrees, double radius, double thickness, double k)
: bendAngleRadians(angleDegrees * M_PI / 180.0), // Convert degrees to radians
insideRadius(radius),
materialThickness(thickness),
kFactor(k) {}
// Method to calculate the bend deduction
double calculateBendDeduction() {
double ossb = (insideRadius + materialThickness) * tan(bendAngleRadians / 2.0);
double ba = (M_PI / 180.0) * bendAngleRadians * (insideRadius + kFactor * materialThickness);
double bd = 2 * ossb - ba;
return bd;
}
};

View File

@ -1,15 +1,65 @@
#include "FormingTool.h" #include "FormingTool.h"
#include "Deserializer.h"
#include "Serializer.h"
#include <iostream>
#include <ostream>
FormingTool::FormingTool(const std::string& name, double toolRadius, const std::string& materialType) FormingTool::FormingTool(const std::string &toolType, double toolSize, const std::string &materialType)
: m_name(name), m_toolRadius(toolRadius), m_materialType(materialType) { : m_toolType(toolType), m_toolSize(toolSize), m_materialType(materialType), m_toolRadius(0.0) // Assuming default value for radius
// Constructor implementation {
} }
double FormingTool::getToolRadius() const { double FormingTool::getToolRadius() const
{
return m_toolRadius; return m_toolRadius;
} }
void FormingTool::setToolRadius(double radius) { double FormingTool::getToolSize() const
{
return m_toolSize;
}
std::string FormingTool::getToolType() const
{
return m_toolType;
}
std::string FormingTool::getMaterialType() const
{
return m_materialType;
}
void FormingTool::setToolRadius(double radius)
{
m_toolRadius = radius; m_toolRadius = radius;
} }
// Implement other methods related to forming tools
void FormingTool::setToolSize(double toolSize)
{
m_toolSize = toolSize;
}
void FormingTool::setToolType(const std::string &toolType)
{
m_toolType = toolType;
}
void FormingTool::setMaterialType(const std::string &materialType)
{
m_materialType = materialType;
}
void FormingTool::useTool()
{
std::cout << "Using " << m_toolType << " of size " << m_toolSize << std::endl;
}
void FormingTool::serialize(std::ofstream &ofs) const
{
ofs << m_toolType << " " << m_toolSize << std::endl;
}
void FormingTool::deserialize(std::ifstream &ifs)
{
ifs >> m_toolType >> m_toolSize;
}