Giter Club home page Giter Club logo

no_fit_polygon's Introduction

more information from SVGNest: A browser-based vector nesting tool. nesting

Rewrite the algorithm in Python.

  1. input_utls.py

Read the dxf file which is writed by CAD and detecte the polygon in the file.

  1. test_nfp.py

The main funciton

In CAD, Use "BREAK" command for changing the polygon to lines.

no_fit_polygon's People

Contributors

liangxuchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

no_fit_polygon's Issues

请问

请问nfp_function里的from Polygon import Polygon 文件是什么可以发一下吗,参考一下

有个小问题

陈先生你好,我对临界多边形的原理大概的学了一下,然后用CAD画了几个图形放入您的代码中跑了一下,结果图形出现了部分重叠,请问可以解答一下是什么原因造成的吗。

求教

你好,看了您的仓库,非常有趣,想请教一个问题,有没有什么办法,能生成如下的图案:
image
也就是,如何把一些预先提供的子元素,比如一条鱼、一只水母、一个篮球等进行摆放,使其形成一个预定义的形状,比如圆环圆盘、U型闭合等。
期待您的回复

DXF实体类型

你好,请问如果dxf文件里的实体类型都是pline该怎么识别?

版本问题

请问一下您这个项目里面的python、polygon等版本都是什么呢?我这安装了好几个都版本不兼容

利用率

你好,你这个里面的rate是什么,是利用率吗?如果不是,请问你是怎么定义的?
这是遗传算法写的吧?谢谢大佬

关于算法的逻辑

您好,可以和您交流下核心算法吗?我现在看懂了您代码中对于dxf文件的处理方法,但是对于核心算法希望能和您请教一下?可以留您一个联系方式吗?或者我们微信交流,我的微信号是18371125809,非常期待能和您交流~

多边形的表示问题

请问一下 shapes 里面的polygon是用什么样的形式保存的,如果我用一组坐标点作为polygon的表示,是否直接把坐标给shapes就可以了?

关于旋转后图片重叠问题about the rotation problem

抱歉打扰您,我最近在尝试使用您的代码,其中input的部分以坐标形式代替。在运行的过程中,如果不进行旋转的情况下能够正常排样,但是一旦将旋转设为2,3,4之后,图形会出现交叠以及小角度倾斜的问题。在调试过程中,发现使用minkowski_difference(A,B)函数计算nfp的时候,如果A或者B在选择旋转后,nfp会出现存在不在第一象限的点,于是我调整使nfp保证在第一象限,并且使得所有多边形在旋转后也处于第一象限位置,但还是没有解决问题。也尝试过,nfp_utils.py文件中对rotate_polygon函数进行浮点数精度的调整,仍然无法解决问题。我认为还是多边形旋转后坐标出现问题,但不知该如何解决,想来求教您。
微信图片_20240510151759

How to start a project?

Hello! This is a bit presumptuous, but could you write a startup guide? I encountered a lot of errors while cloning the repository and trying to run it

polygon library ?

Hello,
I don't know if you will have time to see this, and I know this project is almost 4 years old.
I tried to make it work as a learning project, but I am not sure what polygon library you are using.
I tried with Polygon3, but it did not work.

I get this error with python test_nfp.py :

Traceback (most recent call last):
File "C:\Users\lprad\gcode_clay_processor\experimental\nfp\test_nfp.py", line 28, in
content_loop_rate(best, n, loop_time=2) # T7 , T4
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:-\experimental\nfp\nfp_function.py", line 678, in content_loop_rate
draw_result(res['placements'], n.shapes, n.container, n.container_bounds)
File "C:-\experimental\nfp\nfp_function.py", line 392, in draw_result
shapes.append(Polygon(contour))
^^^^^^^^^^^^^^^^
TypeError: 'module' object is not callable

I'm into building some sort of CAM nesting script.
Have a good day.

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.