Bug 145237 - custom shape uses wrong curve for fill in extrusion in most cases
Summary: custom shape uses wrong curve for fill in extrusion in most cases
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Shapes-Custom
  Show dependency treegraph
Reported: 2021-10-20 12:21 UTC by Regina Henschel
Modified: 2022-11-17 13:47 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

Example shapes to test fill and 3D color (28.00 KB, application/vnd.oasis.opendocument.graphics)
2021-10-20 12:21 UTC, Regina Henschel
Shape with commands F and S for testing extrusion (16.16 KB, application/vnd.oasis.opendocument.graphics)
2021-10-25 12:59 UTC, Regina Henschel

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2021-10-20 12:21:17 UTC
Created attachment 175849 [details]
Example shapes to test fill and 3D color

Open attached document. It has examples for the problem.

The shape consists of two curves. On curve is for the arc with arrow head, the other is for the fill area. If you enable 3D extrusion with the "Toggle extrusion" icon some problems occur.

If the surface is set to "Wireframe", the extrusion is correct.

If the surface is set to "Matt" and the shape has a bitmap, pattern or gradient as fill, then the 3D version does not use the sector for fill.

If the "Surface" is set to "Matt" and the shape has a hatch or color as fill, then it depends of the setting for "3D color", whether extrusion is correct or not. If the "3D Color" is set to "automatic", the extrusion uses correctly the sector. If a color is explicitly set in "3D Color", then the extrusion is wrong the same way as in the bitmap, pattern or gradient case.

[The setting "3D color" determines the color of the side faces. The setting "Surface" should generate presets of material reflection properties, but only "wireframe" and one other is implemented, so "Matt", "Plastic" and "Metal" do all the same.]
Comment 1 Regina Henschel 2021-10-25 12:59:53 UTC
Created attachment 175909 [details]
Shape with commands F and S for testing extrusion

The current way of extrusion of custom shapes has two principle problems:
1. The stroke of the shape is ignored even if it is a fat stroke. That is different from PowerPoint.
2. The enhanced path of the custom shape geometry can have the commands F and S. They disable fill or stroke respectively for a sub-path set. That is ignored by the current algorithm for extrusion.

I have examined the current solution in https://opengrok.libreoffice.org/xref/core/svx/source/customshapes/EnhancedCustomShape3d.cxx?r=5ab21caf#248
I think, a totally new method would be needed.
Comment 2 Buovjaga 2022-11-17 13:47:42 UTC
I don't really understand the details of this as the steps are not sequential, for example how I can select "Surface". If I toggle the extrusion on for the shape that is titled "2D with bitmap fill", it looks the same as "3D wireframe". I guess this shows the problem? I had to customise the drawing toolbar to show the extrusion button.

Arch Linux 64-bit
Version: (X86_64) / LibreOffice Community
Build ID: b57307e8f3553fcb292c9c11fcf58bcef3a6cb3c
CPU threads: 8; OS: Linux 6.0; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 8 November 2022