小编use*_*600的帖子

d3.js图表​​输出到高分辨率打印质量文件?

有没有办法将基于d3.js的html/js中创建的图形,图表,地图等输出到具有出版物打印质量高分辨率的其他数据格式?

这些图表的图形非常棒,但在纸上打印并且高度像素化时会毫无用处.我试图避免在Illustrator中为矢量或photoshop重新绘制它们.

我正在寻找的输出格式应该是Illustrator或Photoshop可读的.最优选的是,一旦输出就不需要更多的视觉操作.如果我不得不重新绘制或重新填充颜色或重新拍摄它以获得效果,那真的会失败的目的.

谢谢!

html photoshop adobe-illustrator d3.js

30
推荐指数
2
解决办法
2万
查看次数

在Python中,我如何体素化3D网格

我需要帮助开始使用Python(我几乎不知道)来体验从Rhino生成的3D网格.数据输入将是.OBJ文件,输出也是如此.这种用法的最终目的是找到建筑物内两点之间的最短距离.但这是为了以后.至于现在,我需要首先体素化3D网格.体素化原语可能只是一个简单的立方体.

到目前为止,我可以从OBJ文件解析器读取并从解析后的obj中读取V,VT,VN,F前缀,并使用这些坐标查找3D对象的边界框.什么应该是对网格进行体素化的正确方法?

import objParser
import math

inputFile = 'test.obj'
vList = []; vtList = []; vnList = []; fList = []

def parseOBJ(inputFile):
list = []
vList, vtList, vnList, fList = objParser.getObj(inputFile)
print 'in parseOBJ'
#print vList, vtList, vnList, fList
return vList, vtList, vnList, fList

def findBBox(vList):
   i = 0; j=0; x_min = float('inf'); x_max = float('-inf'); y_min = float('inf');
   y_max =  float('-inf'); z_min = float('inf'); z_max = float('-inf');
   xWidth = 0; yWidth = 0; zWidth =0

print 'in findBBox' …
Run Code Online (Sandbox Code Playgroud)

python 3d mesh voxel .obj

10
推荐指数
1
解决办法
7148
查看次数

Python索引错误值不在列表中... on .index(value)

我是Python的初学者,对于那些对我的帖子抱有负面想法的人,请离开.我只是在这里寻求帮助并努力学习.我试图在一个简单的数据集中检查0和1.这将用于定义楼层平面图上的空隙和实体,以定义建筑物中的区域...最终0和1将与坐标交换出来.

我收到此错误:ValueError:[0,3]不在列表中

我只是检查一个列表是否包含在另一个列表中.

currentPosition's value is  [0, 3]
subset, [[0, 3], [0, 4], [0, 5], [1, 3], [1, 4], [1, 5], [2, 1], [3, 1], [3, 4], [3, 5], [3, 6], [3, 7]]
Run Code Online (Sandbox Code Playgroud)

这是代码片段:

def addRelationship(locale, subset):
    subset = []; subSetCount = 0
    for rowCount in range(0, len(locale)):
        for columnCount in range (0, int(len(locale[rowCount])-1)):
            height = len(locale)
            width = int(len(locale[rowCount]))
            currentPosition = [rowCount, columnCount]
            currentVal = locale[rowCount][columnCount]
            print "Current position is:" , currentPosition, "=", currentVal

            if (currentVal==0 and subset.index(currentPosition)):
                subset.append([rowCount,columnCount]) …
Run Code Online (Sandbox Code Playgroud)

python indexing list

7
推荐指数
1
解决办法
4万
查看次数

Python,需要帮助将文本文件中的项解析为列表

我正在尝试解析文本文件中的项目并将它们存储到列表中.数据看起来像这样:

[(0, 0, 0), (1, 0, 0), (2, 0, 0), (3, 0, 0), (4, 0, 0), (5, 0, 0), (6, 0, 0)]
[(10, 3, 1), (11, 3, 1), (12, 3, 1), (13, 3, 1), (13, 4, 1)]
[(10, 3, 5), (11, 3, 5), (12, 3, 5), (13, 3, 5), (13, 4, 5), (13, 5, 5), (13, 6, 5)]
[(6, 13, 5), (7, 13, 5), (8, 13, 5), (8, 14, 5), (7, 14, 5), (6, 14, 5), (6, 14, 6)]
Run Code Online (Sandbox Code Playgroud)

我能够剥离"["和"]",但无法将其余信息存储到列表中,格式如下:(x,y,z).有帮助吗? …

python parsing

1
推荐指数
1
解决办法
2269
查看次数

TypeError:'NoneType'对象不可迭代

我有一个函数"checkAllInOneDirection",这是一个递归循环.当我突破循环时,该函数返回1个数组和3个布尔值.最奇怪的是,在递归函数中,当它返回时,它显示所有值都有值但我仍然得到"无类型"错误:

这是印刷品:

Before return : [[0, 0]] False False False False
Run Code Online (Sandbox Code Playgroud)

但是当它返回并且在异常退出之前,返回的值变为

    After returned : [[0, 0]] True True True True
Run Code Online (Sandbox Code Playgroud)

虽然递归后的返回值发生了变化且错误,但仍然有一些值,但我出现了"无类型"错误的异常?这是错误:

     File "C:\xampp\htdocs\ZoneFinding\zoneFinder2D_V2.py", line 127, in handleCheck
    finalCatch, forBoo, bakBoo, upBoo, dwnBoo = checkAllInOneDirection(finalCatch,tempCatch,recursiveCount,newCatch, columnCount, rowCount, width, height, posToCheck, forBoo, bakBoo, upBoo, dwnBoo)
TypeError: 'NoneType' object is not iterable
Run Code Online (Sandbox Code Playgroud)

这是调用递归"checkAllInOneDirection"的函数.

def handleCheck(newCatch, locale, subset, width, height, rowCount, columnCount, posToCheck):
    forBoo = True; bakBoo =True; upBoo=True; dwnBoo= True; lastOneInSet =0;
    while forBoo and bakBoo and upBoo and dwnBoo :
        if …
Run Code Online (Sandbox Code Playgroud)

python recursion typeerror nonetype

0
推荐指数
1
解决办法
3011
查看次数