processing / processing/processing4

Depth sorting not working for lines in PDF or SVG export

オープン
#802 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug core
主要言語
Java
スター
494
フォーク
183
平均マージ
4時間 39分
マージ済み PR(30日)
3

説明

Created by: PBernalPolo

Description

Rendering lines or spheres on the screen works fine. When we render spheres to PDF or SVG, they are depth sorted properly. However, lines are not depth sorted; they are drawn in the order of declaration.

Expected Behavior

Lines should also be drawn according to their depth ordering (at least with hint(ENABLE_DEPTH_SORT) enabled).

Current Behavior

Lines are currently drawn according to their declaration order (even with hint(ENABLE_DEPTH_SORT) enabled).

Steps to Reproduce

Comment/uncomment each line that appears in draw().

import processing.pdf.*;
import processing.svg.*;


void setup()
{
  size( 500 , 500 , P3D );
  hint( ENABLE_DEPTH_SORT );
}


void draw()
{
  // Choose one:
  //drawToScreen();
  drawToPDF();
  //drawToSVG();
}


void drawToPDF()
{
  // Here we generate the PDF document.
  beginRaw( PDF , "output.pdf" );
  drawMyStuff();
  endRaw();
  exit();
}


void drawToSVG()
{
  // Here we generate the SVG image.
  beginRaw( SVG , "output.svg" );
  drawMyStuff();
  endRaw();
  exit();
}


void drawToScreen()
{
  // Here we just draw to the screen.
  drawMyStuff();
}


void drawMyStuff()
{
  background(255);
  lights();
  strokeWeight( 50 );
  
  // First we draw the line that should be shown on top (black).
  stroke( 0 , 0 , 0 );
  line( 250 , 50 , 100 , 250 , 450 , 100 );
  
  // Then the line that should be shown behind (red).
  stroke( 255 , 0 , 0 );
  line( 50 , 250 , -100 , 450 , 250 , -100 );
  
  stroke( 0 , 0 , 0 );
  strokeWeight( 1 );
  
  // First, draw a green sphere that should appear on top.
  pushMatrix();
  fill( 0 , 255 , 0 );
  translate( width*4/10 , height*4/10 , 50 );
  sphere( 70 );
  popMatrix();
  
  // Then draw a blue sphere that should appear behind.
  pushMatrix();
  fill( 0 , 0 , 255 );
  translate( width*3/10 , height*3/10 , -50 );
  sphere( 70 );
  popMatrix();
}

Your Environment

  • Processing version: 4.3
  • Operating System and OS version: ubuntu 22.04

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、提供された Processing 4.3 スケッチを Ubuntu 22.04 上で実行し、ENABLE_DEPTH_SORT を有効にした状態で画面、PDF、SVG の出力を比較します。PDF および SVG のエクスポートパスで、線がどのように送信され、深度順にソートされるかを追跡し、重なり合う線が深度順序に従うことを確認します。同時に、既存の球の動作が変わらないことも確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
computer-graphics
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。