Issue when performing boolean intersection between a volume and surface with Python

Hello,

I am trying to perform a boolean intersection between a box and a surface in rhino using the python script. It seems the operation is not doing anything.

It is a bit strange since I have successfully performed this operation before cutting other circular surfaces. I would be grateful if someone could help me out here.

Thanks to all for your time.

Here I have attached the code ready to be run using a simple example:

import rhinoscriptsyntax as rs
import math

Dext_torre_inf=6 #[m]
Dext_torre_sup=4 #[m]
Dint_torre_inf=2 #[m]
Dint_torre_sup=2 #[m]
H_torre=80       #[m]
ang_torre=15     #[m]
increment=5      #[m]
excentricity=0   #[m] Has not been applied in the longitudinal reinforcements
ganma=30         #[deg] Angle of the 3rd and 4th longitudinal reinforcements according to Y axis 

#Trigonometry to obtain cylinder base distances

ang_rad=math.radians(ang_torre)
coor_x=math.tan(ang_rad)
sen=math.sin(ang_rad)
cos=math.cos(ang_rad)
senbetaDegrees1=(Dext_torre_inf-Dext_torre_sup)/H_torre
betaDegrees1=math.asin(senbetaDegrees1)
beta_rad1=math.radians(betaDegrees1)
senBeta1=math.sin(beta_rad1)
senbetaDegrees2=(Dint_torre_inf-Dint_torre_sup)/H_torre
betaDegrees2=math.asin(senbetaDegrees2)
beta_rad2=math.radians(betaDegrees2)
senBeta2=math.sin(beta_rad2)

h1=(Dext_torre_inf/2)/cos
z1=sen*h1
w1=z1*senBeta1
f1=w1/cos
Dist_final1=h1+f1

h2=(Dint_torre_inf/2)/cos
z2=sen*h2
w2=z2*senBeta2
f2=w2/cos
Dist_final2=h2+f2



point1R=rs.AddPoint((Dist_final1,0,0))
point2R=rs.AddPoint((Dist_final2+excentricity,0,0))
point3R=rs.AddPoint((-(H_torre+increment)*coor_x+Dext_torre_sup/2,0,H_torre+increment))
point4R=rs.AddPoint((-(H_torre+increment)*coor_x+Dint_torre_sup/2+excentricity,0,H_torre+increment))

R1=rs.AddSrfPt([point1R,point2R,point3R,point4R])


point1=rs.AddPoint((-100,100,0))
point2=rs.AddPoint((100,100,0))
point3=rs.AddPoint((-100,-100,0))
point4=rs.AddPoint((100,-100,0))

point5=rs.AddPoint((-100,100,80))
point6=rs.AddPoint((100,100,80))
point7=rs.AddPoint((-100,-100,80))
point8=rs.AddPoint((100,-100,80))

cube=rs.AddBox([point1,point3,point4,point2,point5,point7,point8,point6])

rs.BooleanIntersection(R1,cube)

Hi @alvaro.ortega,

Perhaps a Boolean operation, which is generally applied to solid objects, isn’t the best tool in this case. You might consider either splitting or trimming the box with the surface (cutter).

– Dale