Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
3

Translucency lost after applying add_condition method

asked 5 years ago

Juanjo gravatar image

updated 5 years ago

I need to render translucent implicit surfaces satisfying some additional constraints, such as, for example, the portion of the hyperboloid x2+y2z2=1 which is above the paraboloid z=(x1)2+y21. The problem I found is that the opacity property is not preserved after applying the add_condition method. To be more concrete, the following code plots a gray, translucent hyperboloid:

var("x,y,z")
texture = dict(color="gray", opacity=0.6)
s = implicit_plot3d(x^2+y^2-z^2==1, (x,-3,3), (y,-3,3), (z,-2.5,2.5), **texture)
opts = dict(viewer="threejs", decimals=1)
s.show(**opts)

Let us apply the constraint:

s1 = s.add_condition(lambda x,y,z: z>(x-1)^2+y^2-1,10)
s1.show(**opts)

One gets a gray, but opaque, surface. Translucency is lost. I have found the following workaround:

from sage.plot.plot3d.index_face_set import IndexFaceSet
s2 = IndexFaceSet(s1.face_list(), **texture)
s2.show(**opts)

which yields the expected result. So I wonder if the loss of translucency is a bug. Anyway, is there a better workaround?

This Sagecell contains the above code.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 5 years ago

FrédéricC gravatar image

This is fixed by https://trac.sagemath.org/ticket/28783

Please help by revieweing this ticket.

Preview: (hide)
link

Comments

I have been reading how to review tickets. But unfortunately things like using git or rebuilding code still scares me a lot. So, is there a simple way I could get the modified code to test it? It seems to me that a manual edit of the file src/sage/plot/plot3d/index_face_set.pyx is not the way to go.

Juanjo gravatar imageJuanjo ( 5 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 5 years ago

Seen: 332 times

Last updated: Nov 15 '19