Giter Club home page Giter Club logo

Comments (4)

caixw avatar caixw commented on June 12, 2024

不是很理解你的意思,如果你说的是原来定义的那几种方块是一个多边形,现在因为你要做得“破碎”的需求,变成了多个多边形,无法生成旋转一定角度之后的图案。我的建议是把原来的九宫格改成 25 格的,然后每个小方块的图案依然采用单个多边形。

from identicon.

CL-Jeremy avatar CL-Jeremy commented on June 12, 2024

不是的,我现在使用的是 16 宫格,每个块中确实有数量不等的多边形(原来也有部分块是这样的)。

如果查看我代码中上一个 commit,那时候已经在设计上实现我的要求了,理论上也可以直接使用,但我个人希望的是,polygon.go 中的判定函数在判定时包括一像素的边框,这样在绘制的时候是顶格的,而不会是现在这样,每次绘制会在周围留下一像素的空隙。

from identicon.

caixw avatar caixw commented on June 12, 2024

if mul := (x1-x)*(y2-y) - (x2-x)*(y1-y); mul >= 0 {

改成 >= 0 应该会有所改善。
还有就是将坐标值类型从 float64 改成 int,不存在小数换算的差值也会好很多。

from identicon.

CL-Jeremy avatar CL-Jeremy commented on June 12, 2024

改成 >= 0 应该会有所改善。

我确实是这样改的
https://piramisancchi.live-on.net:9175/gitea/identicon/commit/a8ea9ddea9c6fc25082bb19177d59d32312d0d35

还有就是将坐标值类型从 float64 改成 int,不存在小数换算的差值也会好很多。

有道理,我目前确实只需要用到宽度的 1/8,确实比三等分对小数依赖较少

from identicon.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.