小编Thi*_*ser的帖子

如何在revit中找到ramp的开始/结束,也许用草图?

我有一堆斜坡,我想知道它的开始和结束点(如果有多个开始/结束点,我想知道它们是如何连接的).我目前得到这些

List<TransitionPoint> ret = new List<TransitionPoint>();
FilteredElementCollector collector = new FilteredElementCollector(doc);
ICollection<Element> ramps = collector.OfCategory(BuiltInCategory.OST_Ramps).ToElements();

foreach (var ramp in ramps)
{
   //what goes here?
}
Run Code Online (Sandbox Code Playgroud)

这些斜坡包含以下属性:

Type Comments
Ramp Max Slope (1/x)
Category
URL
Design Option
Type Name
Ramp Material
Function
Manufacturer
Family Name
Model
Keynote
Type Image
Text Size
Shape
Text Font
Maximum Incline Length
Assembly Description
Assembly Code
Type Mark
Category
Thickness
Cost
Description
Run Code Online (Sandbox Code Playgroud)

现在,如果这些楼梯我将使用ICollection stairs = collector.OfCategory(BuiltInCategory.OST_Stairs).OfClass(typeof(Stairs)).ToElements(); 然后我可以将对象投射到楼梯但是似乎没有一个类的simmulair到楼梯,这将允许我adresStairs.GetStairsRuns().

任何人都知道如何获得像RampRun这样的东西或者找到斜坡的开始和结束?

我也尝试了以下溶剂,但这也没有用

public static void MapRunsToRamps(Document doc)
{ …
Run Code Online (Sandbox Code Playgroud)

c# api autodesk revit revit-api

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

NuGet有缺少包的问题,​​如何恢复?

当我尝试编译我的程序时,我收到以下错误:

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=317567.    
Run Code Online (Sandbox Code Playgroud)

现在,当我右键单击解决方案并按下

All packages are already installed and there is nothing to restore.
Run Code Online (Sandbox Code Playgroud)

我尝试手动重新安装每个没有解决问题的包,我尝试重新安装NuGet,但这也没有帮助,我甚至尝试重新安装visual studio.

我也试过从tfs文件夹移动包文件夹来覆盖我的包文件夹但是没有解决任何问题.我也尝试用这个包丢失来重新加载它们,这也没有解决问题.

有谁知道如何恢复nuget包?

c# visual-studio nuget nuget-package-restore visual-studio-2015

18
推荐指数
3
解决办法
1万
查看次数

合并触摸多边形给出错误的结果

我正在尝试编写一段代码,给出一个多边形列表(定义为IntPoints列表列表)检查是否有任何触摸,如果是,则将它们合并为一个多边形.为了做到这一点,我已经尝试了以下两种方法:

List<List<IntPoint>> output=new List<List<IntPoint>>();
output = Clipper.SimplifyPolygons(input,PolyFillType.pftPositive);
Run Code Online (Sandbox Code Playgroud)

Clipper c = new Clipper();
c.AddPaths(input, PolyType.ptClip, true);
c.Execute(ClipType.ctUnion, output);
Run Code Online (Sandbox Code Playgroud)

现在这两个都很容易将多边形合并在一起,但它们有点过于粗糙,因为任何多边形开放空间都会被忽略,而开放区域只是组合成一个多边形,这意味着: 作为两个不接触的多边形的纯粹恐怖被合并为一个没有任何意义或生命的方形

发生.现在这显然是错误的,因为这两个多边形不相互接触.两种方法都会出现相同的结果.结果与输入相同.知道如何解决这个问题吗?sollution不必使用限幅器库(我没有与它结合)但我确实需要使用由点列表定义的多边形的东西输入是List>其中Intpoint只是一个包含x的结构和y.

编辑我注意到当另一个多边形内没有多边形时也会出现这个问题,所以解决方案总是"填充"编辑编辑:这里也是一个输入可能是什么样的例子

input[0][0]
{ClipperLib.IntPoint}
    X: -724
    Y: -472
input[0][1]
{ClipperLib.IntPoint}
    X: 428
    Y: -472
input[0][2]
{ClipperLib.IntPoint}
    X: 428
    Y: -472
  input[0][3]
{ClipperLib.IntPoint}
    X: 428
    Y: 632
input[0][4]
{ClipperLib.IntPoint}
    X: 428
    Y: 632
input[0][5]
{ClipperLib.IntPoint}
    X: -724
    Y: 632
input[0][6]
{ClipperLib.IntPoint}
    X: -724
    Y: 632
input[0][7]
{ClipperLib.IntPoint}
    X: -724
    Y: -472
input[0][8]
{ClipperLib.IntPoint}
    X: -88
    Y: -218
input[0][9]
{ClipperLib.IntPoint}
    X: -107
    Y: …
Run Code Online (Sandbox Code Playgroud)

c# geometry 2d polygon clipperlib

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

在matlab prtools中如何设置继续标签?

我有一个带有标签和数据点的数据集,问题是我想得到一个分类问题,我想得到一个linair估算器,例如:

dataset=prdataset([2,4,6,8]',[1,2,3,4]')
testset=prdataset([3,5,7,9]')
classifier=dataset*ldc %should probably be changed?
result=testset*classifier
Run Code Online (Sandbox Code Playgroud)

result.data 现在变成了

ans =

  1.0e-307 *

    0.2225    0.2225    0.2225    0.2225
    0.2225    0.2225    0.2225    0.2225
    0.2225    0.2225    0.2225    0.2225
    0.2225    0.2225    0.2225    0.2225
Run Code Online (Sandbox Code Playgroud)

这是非常错误的.

理想情况下它会[1.5,2.5,3.5,4.5]'接近它.知道如何在PRtools或simulair中做到这一点吗?这是一个linair依赖,但我也希望能够玩其他类型的依赖?

此外,系统的一个巨大奖励是对NaN值有些聪明,它严重地对我的真实数据集进行了严格的评估.

我已经发现了linearr类,但是当我使用它时,我会得到奇怪大小的数据集作为回报,

dataset=prdataset([2,4,6,8]',[1,2,3,4]')
testset=prdataset([3,5,7,9]')
classifier=dataset*linearr%should probably be changed?
result=testset*classifier
Run Code Online (Sandbox Code Playgroud)

给了我价值

    0.1000   -0.3000   -0.7000   -1.1000
   -0.5000   -0.5000   -0.5000   -0.5000
   -1.1000   -0.7000   -0.3000    0.1000
   -1.7000   -0.9000   -0.1000    0.7000
Run Code Online (Sandbox Code Playgroud)

这又是不正确的.

在聊天中,他们建议使用.*而不是*导致使用错误*内部矩阵维度必须同意.

Error in linearr (line 42)
      beta = prinv(X'*X)*X'*gettargets(x);

Error in prmap (line 139)
      [d, varargout{:}] = feval(mapp,a,pars{:}); …
Run Code Online (Sandbox Code Playgroud)

statistics matlab regression machine-learning data-science

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

通过数据库传递密码如何使其安全

我正在开发一个在多个服务器上运行的应用程序.其中一个服务器处理输入,其他服务器执行它.由于公司政策,一切都必须通过数据库,不允许实例之间的套接字.

现在这适用于所有事情,但有一件令我担心的是密码.我目前正在实现一些需要用户密码才能以纯文本形式到达其中一个应用程序的东西.现在我明白这永远不会100%安全,但我如何将风险降至最低?目前我计划将pw放入数据库并在数据库到达后从数据库中擦除它.日志每天删除一次.我怎样才能明智地改善这种安全性?

c# sql sql-server security

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

从包含此类信息的元素获取有关楼梯和楼梯的信息

您好我有以下代码:

   public static void HandleStairs(Document doc)
        List<TransitionPoint> ret = new List<TransitionPoint>();
        FilteredElementCollector collector = new FilteredElementCollector(doc);
        ICollection<Element> stairs = collector.OfCategory(BuiltInCategory.OST_Stairs).ToElements();
            foreach (var stair in stairs)
             {
                 var st= stair as Stairs;
                 if(st!=null)
                 {
                        %code that is never executed
                 } 
            }

        return ret;
    }
Run Code Online (Sandbox Code Playgroud)

现在的问题是,无论看起来楼梯总是空的,我听说另一个程序员也有同样的问题.

楼梯变量确实接收了一些具有stairlike属性的物体(被命名为楼梯,有立管和平台分机),但实际上并不接受被施放到楼梯上.有人知道如何将其实际投入楼梯(或以其他方式获取文档中的所有楼梯吗?)

请注意,stairs是具有以下属性的元素:

Riser to Tread Connection
Monolithic Material
Apply Nosing Profile
Stringer Material
Text Size
Begin with Riser
Stringer Carriage Height
URL
Open Stringer Offset
Right Stringer
Riser Type
Cost
Left Stringer
Underside of Winder
Stringer …
Run Code Online (Sandbox Code Playgroud)

c# null revit revit-api revit-2015

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

将黑白图像完全转换为一组线(也称为仅使用线进行矢量化)

我有许多黑白图像,想将它们转换为一组线,这样我就可以从这些线完全或至少接近完全重建原始图像。换句话说,我正在尝试将图像矢量化为一组线。

我已经看过HoughLinesTransform,但是它并没有覆盖图像的每个部分,而是更多关于在图像中查找线条,而不是将图像完全转换为线条表示。另外,线变换不对线的实际宽度进行编码,这让我猜测如何重新构造图像(我需要这样做,因为这是训练机器学习算法的前一步)。

到目前为止,我已经使用houghLineTransform尝试了以下代码:

import numpy as np
import cv2

MetersPerPixel=0.1

def loadImageGray(path):
    img=(cv2.imread(path,0))
    return img

def LineTransform(img):
    edges = cv2.Canny(img,50,150,apertureSize = 3)
    minLineLength = 10
    maxLineGap = 20
    lines = cv2.HoughLines(edges,1,np.pi/180,100,minLineLength,maxLineGap)
    return lines;

def saveLines(liness):
    img=np.zeros((2000,2000,3), np.uint8)
    for lines in liness:
        for x1,y1,x2,y2 in lines:
            print(x1,y1,x2,y2)
            img=cv2.line(img,(x1,y1),(x2,y2),(0,255,0),3)
    cv2.imwrite('houghlines5.jpg',img)

def main():
    img=loadImageGray("loadtest.png")
    lines=LineTransform(img)
    saveLines(lines)

main()
Run Code Online (Sandbox Code Playgroud)

但是,当使用以下方法进行测试时 图片

我得到了这张图片: 输出

如您所见,它丢失了未与轴对齐的线,并且如果您仔细观察,即使检测到的线也被分割成2条线,并且它们之间有一定间隔。我还必须以预设的宽度绘制这些图像,而实际宽度未知。

编辑:根据@MarkSetchell的建议,我通过使用以下代码尝试了pypotrace,当前它在很大程度上忽略了贝塞尔曲线,只是试图像它们是直线一样工作,稍后我将重点关注该问题,但是现在结果不正确。 t最佳:

def TraceLines(img):
    bmp = potrace.Bitmap(bitmap(img))
    path=bmp.trace()
    lines=[]
    i=0
    for curve in path:
        for segment in curve:
            print(repr(segment))
            if segment.is_corner: …
Run Code Online (Sandbox Code Playgroud)

python opencv image-processing computer-vision python-3.x

5
推荐指数
2
解决办法
286
查看次数

几个并排div的CSS/HTML居中

我正在创建一个网站,需要将几块文本和图片放在一起.但我也希望他们能够集中精力.我正在为每个元素使用一个设置大小,所以如果有人调整屏幕大小,我希望我的页面不断更改彼此相邻的div数.通常我会使用float:left; 为此,但这不会起作用,因为我希望我的页面集中在中间.

所以看起来有点像这样:

________
|1 2 3 4| 
|  5 6  |
|_______|
Run Code Online (Sandbox Code Playgroud)

但是当我调整屏幕大小时,它看起来像这样:

______
|1 2 3|
|4 5 6|
|_____| 
Run Code Online (Sandbox Code Playgroud)

如果我放大,它看起来像这样:

___________
|1 2 3 4 5 |
|    6     |
|__________|
Run Code Online (Sandbox Code Playgroud)

目前css看起来像这样:

 div.child{
width:23%;
float:left;
height:600px;
padding:0px;
min-width:200px;
max-width:230px;
overflow:hidden;
text-align:center;
border-style:solid;
border-width:5px;
overflow:visible;
display:inline-block;
}
Run Code Online (Sandbox Code Playgroud)

div.parrent{
padding:0px;
border-style:solid;
border-top-style:solid;
border-width:5px;
overflow:hidden;
text-align:center;
}
Run Code Online (Sandbox Code Playgroud)

有人有任何提示吗?

html css css-float centering

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

caffe安装:gcc错误命名空间"std"没有成员"isnan"

我正在尝试在ubuntu 17.10上安装(py)caffe

但是当我这样做时,make all我收到以下错误:

./include/caffe/common.hpp(84): error: namespace "std" has no member "isnan"

./include/caffe/common.hpp(85): error: namespace "std" has no member "isinf"

2 errors detected in the compilation of "/tmp/tmpxft_00004921_00000000-19_nesterov_solver.compute_61.cpp1.ii".
Makefile:594: recipe for target '.build_release/cuda/src/caffe/solvers/nesterov_solver.o' failed
Run Code Online (Sandbox Code Playgroud)

或者当我使用cmake时

/home/thijser/caffe/include/caffe/common.hpp(84): error: namespace "std" has no member "isnan"

/home/thijser/caffe/include/caffe/common.hpp(85): error: namespace "std" has no member "isinf"

2 errors detected in the compilation of "/tmp/tmpxft_00004e32_00000000-7_math_functions.cpp1.ii".
CMake Error at cuda_compile_1_generated_math_functions.cu.o.Release.cmake:282 (message):
  Error generating file
  /home/thijser/caffe/build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/./cuda_compile_1_generated_math_functions.cu.o
Run Code Online (Sandbox Code Playgroud)

请注意,我不仅仅是为了sudo apt-get install caffe,因为这样做也不会安装pycaffe,任何安装pycaffe的解决方案也都有效.我知道std中的isnan可能来自boost或者这在某种程度上涉及c ++版本之间的差异?我不是一个c ++专家,所以我不确定它是如何工作的,我使用gcc4.9,因为nvcc不喜欢更高版本的gcc.我知道caffe适用于其他人的机器和我安装的旧版本的ubuntu,这表明它是一个配置问题.

有谁知道如何解决这个问题?

在cmake上使用详细模式编辑我能够发现它正在执行以下操作

/usr/bin/cmake …
Run Code Online (Sandbox Code Playgroud)

c++ ubuntu gcc nvcc caffe

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

错误/usr/include/string.h:652:42:错误:构建caffe时未在此范围内声明'memcpy'

我正在尝试按照本指南编译caffe:https://gist.github.com/wangruohui/679b05fcd1466bb0937f

但是,当我得到make all我也得到错误

NVCC src/caffe/layers/hdf5_data_layer.cu
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
   return (char *) memcpy (__dest, __src, __n) + __n;
                                          ^
Makefile:585: recipe for target '.build_release/cuda/src/caffe/layers/hdf5_data_layer.o' failed
Run Code Online (Sandbox Code Playgroud)

但是/usr/include/string.h甚至不在caffe代码中,那么是什么给出了?这是一个密切关注16.04的ubuntu变体

看作代码的来源是众所周知的回购,我认为问题可能在Makefile或Makefile.config中

c++ cuda compiler-errors makefile compilation

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