-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Junjun Guo
authored
Jan 16, 2021
1 parent
c22533f
commit 4fab392
Showing
18 changed files
with
29,986 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
###################################################################################### | ||
# Author: Junjun Guo | ||
# E-mail: [email protected]/[email protected] | ||
# Date: 1/16/2021 | ||
# Environemet: Successfully excucted in python 3.8 | ||
###################################################################################### | ||
from sectionFiberMain import circleSection | ||
name="circleHole" #section name | ||
outD = 2 # the diameter of the outside circle | ||
coverThick = 0.06 # the thinckness of the cover concrete | ||
outbarD = 0.03 # outside bar diameter | ||
outbarDist = 0.15 # outside bar space | ||
coreSize = 0.1 # the size of core concrete fiber | ||
coverSize = 0.1 # the size of cover concrete fiber | ||
plotState = True # plot the fiber or not plot=True or False | ||
inD =1 # the diameter of the inside circle | ||
inBarD=0.03 # inside bar diameter | ||
inBarDist=0.15 # inside bar space | ||
corFiber, coverFiber, barFiber = circleSection(name,outD, coverThick, outbarD, outbarDist, coreSize, coverSize, | ||
plotState,inD,inBarD,inBarDist) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
###################################################################################### | ||
# Author: Junjun Guo | ||
# E-mail: [email protected]/[email protected] | ||
# Date: 1/16/2021 | ||
# Environemet: Successfully excucted in python 3.8 | ||
###################################################################################### | ||
from sectionFiberMain import circleSection | ||
name="circle"#section name | ||
outD=2 # the diameter of the outside circle | ||
coverThick=0.05 # the thinckness of the cover concrete | ||
outbarD=0.03 # outside bar diameter | ||
outbarDist=0.15 # outside bar space | ||
coreSize=0.1 # the size of core concrete fiber | ||
coverSize=0.1 # the size of cover concrete fiber | ||
plotState=True # plot the fiber or not plot=True or False | ||
corFiber,coverFiber,barFiber=circleSection(name,outD, coverThick, outbarD, outbarDist, coreSize, coverSize,plotState) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#-*-coding: UTF-8-*- | ||
###################################################################################### | ||
# Author: Junjun Guo | ||
# E-mail: [email protected]/[email protected] | ||
# Date: 05/02/2020 | ||
###################################################################################### | ||
###################################################################################### | ||
import numpy as np | ||
import math | ||
###################################################################################### | ||
def is_in_2d_polygon(point, vertices): | ||
"""determine whether the point in the closed curved lines composed of vertices""" | ||
px = point[0] | ||
py = point[1] | ||
angle_sum = 0 | ||
|
||
size = len(vertices) | ||
if size < 3: | ||
raise ValueError("len of vertices < 3") | ||
j = size - 1 | ||
for i in range(0, size): | ||
sx = vertices[i][0] | ||
sy = vertices[i][1] | ||
tx = vertices[j][0] | ||
ty = vertices[j][1] | ||
#determine whether the node in a line based on the distance from the node to the line | ||
# y = kx + b, -y + kx + b = 0 | ||
k = (sy - ty) / (sx - tx + 0.000000000001) # avoid divide zero | ||
b = sy - k * sx | ||
dis = np.abs(k * px - 1 * py + b) / np.sqrt(k * k + 1) | ||
if dis < 0.000001: #the node in the line | ||
if sx <= px <= tx or tx <= px <= sx: #the node in the line | ||
return True | ||
#calculate the angle | ||
angle = math.atan2(sy - py, sx - px) - math.atan2(ty - py, tx - px) | ||
#the angle shoule with [-pi,pi] | ||
if angle >= math.pi: | ||
angle = angle - math.pi * 2 | ||
elif angle <= -math.pi: | ||
angle = angle + math.pi * 2 | ||
#cumulation | ||
angle_sum += angle | ||
j = i | ||
#calculate the diffrence between the sum angles and 2pi with a small threshold | ||
return np.abs(angle_sum - math.pi * 2) < 0.00000000001 | ||
######################################################################################## | ||
# | ||
# closedNodeValues=[[0,0],[2,0],[2,1],[1,1],[1,2],[2,2],[2,3],[0,3],[0,0]] | ||
# print(is_in_2d_polygon([1.01,1.01], closedNodeValues)) |
Oops, something went wrong.