This question was edited from the original for more clarity.
I have a python code to plot two surfaces. However, they overlap each other in line where I would like to "trim" those surfaces so I could get a perfect edge at their intersection. My code so far is:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import time
import pdb
start_time = time.time()
fig = plt.figure(figsize=(8,4))
ax = fig.add_subplot(projection='3d')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
x = np.linspace(-2.5,3.104,1000)
y = np.linspace(-0.746,0,1000)-1
X, Y = np.meshgrid(x, y)
Z = -1.0716*(Y+1)
solid = ax.plot_surface(X,Y,Z,cmap=cm.coolwarm,linewidth=0, antialiased=True)
y = np.linspace(-1.746,1,1000)
x = np.linspace(0,0.604,1000) + 2.5
X, Y = np.meshgrid(x, y)
Z = 1.323*(X-2.5)
solid = ax.plot_surface(X,Y,Z,cmap=cm.coolwarm,linewidth=0, antialiased=True)
My original plan was to plot those two "corner" regions separately as triangles that I know the vertices, however, it was not clear how could I adopt the same color mapping that I desire since the convenient way to do these triangular regions is to set a limited plane, for example, this question, where the triangle is defined by setting Z[Z<0]=0
.
The problem is that I don't know how to set a similar condition to define my triangular region since it depends on a line inside that plane, which is not a constant as in the other question. All the points where the intersections between the planes occur can be calculated, I just don't know how do I set this visualization on Python. Thank you in advance!