Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crossects dimensions #199

Merged
merged 5 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions model_obj/crosssects/breadloaf/CrossSectBreadloaf.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
%calculate coordinates each point starting in bottom right
%corner and moving counterclockwise around the breadloaf

p1 = [ w/2, 0 ];
p1 = [ w/2, feval(class(w), 0)];
p2 = [ w/2 - l*cos(alpha), l*sin(alpha) ];
p3 = [-w/2 + l*cos(alpha), l*sin(alpha) ];
p4 = [-w/2, 0 ];
p4 = [-w/2, feval(class(w), 0)];

beta = asin(p2(1)/r);
base = r*cos(beta);
arcCenter = [0, -(base - p2(2))];
arcCenter = [feval(class(w), 0), -(base - p2(2))];

%transform coords
p1 = obj.location.transformCoords(p1);
Expand All @@ -53,7 +53,7 @@
[leftSeg] = drawer.drawLine(p3, p4);
[baseSeg] = drawer.drawLine(p4, p1);

innerCoord = obj.location.transformCoords( [0, l*sin(alpha)/2] );
innerCoord = obj.location.transformCoords([feval(class(w), 0), l*sin(alpha)/2] );

segments = [rightSeg, arc, leftSeg, baseSeg];
csToken = CrossSectToken(innerCoord, segments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
r = obj.dim_r_o;
t = obj.dim_t;

x_out = 0;
x_in = 0;
x_out = feval(class(t), 0);
x_in = feval(class(t), 0);
x = [x_out, x_out, x_in, x_in];

y_out = r;
Expand Down
4 changes: 2 additions & 2 deletions model_obj/crosssects/hollowRectangle/CrossSectHollowRect.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

function [csToken] = draw(obj, drawer)
validateattributes(drawer, {'DrawerBase'}, {'nonempty'});
axis = DimMillimeter([0,0]);
w=obj.dim_w;
h=obj.dim_h;
t1=obj.dim_t1;
t2=obj.dim_t2;
t3=obj.dim_t3;
t4=obj.dim_t4;
t4=obj.dim_t4;
axis = feval(class(w), [0,0]);

% Create inner and outer points
points_i=[axis(1)+t3,axis(2)+t4; axis(1)+t3,axis(2)+h-t2;...
Expand Down