8000 [orx-shapes] operator `roundCorners` only works between straight segments · Issue #355 · openrndr/orx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[orx-shapes] operator roundCorners only works between straight segments #355
Open
@hamoid

Description

@hamoid

Operating System

Linux

OPENRNDR version

0.4.5-alpha8

ORX version

0.4.5-alpha8

Java version (if applicable)

No response

Describe the bug

contour.roundCorners(x) only rounds corners formed by pairs of straight segments.

I will investigate why.

Steps to reproduce the bug

import org.openrndr.application
import org.openrndr.extra.shapes.adjust.adjustContour
import org.openrndr.extra.shapes.operators.roundCorners
import org.openrndr.shape.Rectangle

fun main() = application {
    program {
        extend {
            val contours = listOf(
                Rectangle(100.0, 100.0, 100.0, 100.0).contour,
                adjustContour(Rectangle(400.0, 100.0, 100.0, 100.0).contour) {
                    selectVertex(0)
                    vertices.forEach { it.rotate(30.0) }
                }
            )

            val contoursRounded = contours.map {
                it.roundCorners(10.0)
            }

            drawer.contours(contours)
            drawer.translate(0.0, 150.0)
            drawer.contours(contoursRounded)
        }
    }
}

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0