PCBNEW: Inconsistent generation of solder mask when exporting to STEP file

Description

For some artifacts, there is solder mask in places where it should be keyed. Test_Mask.zip

PCB Editor:

01_PCB_Editor


3D Viewer - Correct display:

02_3D_Viewer


Generated and displayed STEP file:

Filled Circle - Okay

Filled Rectangle - Okay

Non Copper Zone - Wrong, the mask is over the zone

SMD Pad - Wrong, the mask is over the pad shape

THT Pad - Wrong, the mask is over the pad diameter. Okay, the mask is not through the hole

Vias - Wrong, the mask goes through the hole

03_STEP_Viewer

Steps to reproduce

  1. Open PCB File
  2. File -> Export -> STEP
  3. Board Options: Check mark: Export board body, Cut vias board body, Export silkscreen, Export soldermask
  4. Export

KiCad Version

Application: KiCad x64 on x64

Version: 9.0.1-rc2, release build

Libraries:
	wxWidgets 3.2.6
	FreeType 2.13.3
	HarfBuzz 10.2.0
	FontConfig 2.15.0

Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW

	wxWidgets: 3.2.6 (wchar_t,wx containers)
	Boost: 1.86.0
	OCC: 7.8.1
	Curl: 8.11.1-DEV
	ngspice: 44
	Compiler: Visual C++ 1942 without C++ ABI
	KICAD_IPC_API=ON

Locale: 
	Lang: en_GB
	Enc: UTF-8
	Num: 1,234.5
	Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)