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

Update to include new Polygon background #199

Merged
merged 3 commits into from
Jan 19, 2024
Merged

Conversation

rocky
Copy link
Member

@rocky rocky commented Jan 19, 2024

  • Revise Polygon background example to set background.
  • Untabify to make it clear what indentation is.
  • Split into multiple lines, long polygon example.

@mmatera
Copy link
Contributor

mmatera commented Jan 19, 2024

@rocky, I do not understand the example. Some good examples to add would be

Graphics[Disk[], Background->RGBColor[.1,.3,1.]]
Graphics3D[Sphere[], Background->RGBColor[.1,.3,1.]]

and for errors,

Graphics[{Disk[],NoPrimitive[]}, Background->RGBColor[.1,.3,1.]]
Graphics3D[{Sphere[], NoPrimitive[]}, Background->RGBColor[.1,.3,1.]]

Notice that Polygon is not yet defined for 3D graphics, and that, with the last changes, the background is set as a true background, not by adding a primitive.

@rocky
Copy link
Member Author

rocky commented Jan 19, 2024

Let's back up a little.

The gallery is not a tutorial. It is not intended to explain features, just show that they exist using interesting or visually stunning examples. Also we would like to keep the number of examples down small.

The documentation is there documenting and understanding examples and primitive components in the examples. Something like Graphics[Disk[], Background->RGBColor[.1,.3,1.]] is not very interesting and does not make a catchy display.

The example can be complicated if it makes a good visual. (Of course less complicated examples that make good visuals are even better. Here, unfortunately we do not have the primitives that would simplify drawing this or other even better examples.)

Therefore adding a background color to one of the existing examples is the way to go. I had also tried this on the "star" example before (that shows we respect crossing number correct in polygon paths) but somehow to me it makes the bottom arrow of the star look funny.

Possibly what you are suggesting should go in as an example in one for one of the examples in the documentation. Preferably as an example in a section where the examples are scarce. I am not seeing that we have "Background" documented anywhere. That is possibly where those examples might go. Another place is to fill out RGBColor with more interesting examples and one that shows the use of real-valued R, G, and B values.

But this is done in mathics-core not here.

@mmatera
Copy link
Contributor

mmatera commented Jan 19, 2024

OK, in that case, LGTM.
Maybe, a slight improvement would be

Graphics3D[Arrow[{{1, 1, -1}, {2, 2, 0}, {3, 3, -1}, {4, 4, 0}}]]

by

Graphics3D[Arrow[{{1, 1, -1}, {2, 2, 0}, {3, 3, -1}, {4, 4, 0}}],Background->RGBColor[.4,.8,1.]]

@rocky rocky merged commit f658aa3 into master Jan 19, 2024
11 checks passed
@rocky rocky deleted the update-gallery-example branch January 19, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants