Giter VIP home page Giter VIP logo

wolframresearch / opencascadelink Goto Github PK

View Code? Open in Web Editor NEW
32.0 14.0 7.0 514.43 MB

Open source package for OpenCascadeLink, which is bundled with Wolfram Language products as of version 12.1

License: Other

Mathematica 10.52% C++ 86.42% C 3.06%
wolfram-language opencascade wolfram-engine wolfram-mathematica mathematica wolframlanguage finite-element-methods finite-element-analysis

opencascadelink's People

Contributors

ilian8 avatar jfultz avatar ruebenko 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

Watchers

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

opencascadelink's Issues

OpenCascadeShapeUnion/Intersection/Difference return wrong result in some cases.

This returns a wrong result:

    Needs["OpenCascadeLink`"]
    Needs["NDSolve`FEM`"]
    shape = OpenCascadeShape[CapsuleShape[{{0, -2, 0}, {0, 0, 1}}, 1]];
    r = ImplicitRegion[x^4 + y^4 + z^4 - 1 == 0, {x, y, z}];
    bmesh = ToBoundaryMesh[r, {{-2, 2}, {-2, 2}, {-2, 2}}];
    shape2 = OpenCascadeShape[bmesh];
    union = OpenCascadeShapeUnion[shape2, shape];
    OpenCascadeShapeSurfaceMeshToBoundaryMesh[union]["Wireframe"]

but these

    r = ImplicitRegion[x^4 + y^4 + z^4 - 1 <= 0, {x, y, z}];
    r = ImplicitRegion[x^4 + y^4 + z^4 - 1 < 0, {x, y, z}];
    r = ImplicitRegion[x^4 + y^4 + z^4 - 1 > 0, {x, y, z}];
    r = ImplicitRegion[x^4 + y^4 + z^4 - 1 >= 0, {x, y, z}];

return the correct result. For the broken case either use

    r = ImplicitRegion[x^4 + y^4 + z^4 - 1 <= 0, {x, y, z}];

Or this workaround can be used:

mp = MeshPrimitives[DiscretizeRegion[r], 2];
shape2 = OpenCascadeShapeSewing[
   OpenCascadeShape[Polygon[#]] & /@ (Reverse /@ mp[[All, 1]])];

Dealing with 2D cases

I'm interested in meshing a segment from an image and exporting this as a STEP file, for example:
test-segment

Meshing the image is pretty straightforward as in:
ToBoundaryMesh@DiscretizeRegion@ImageMesh@image
or
DiscretizeRegion@ImageMesh@image

Does OpenCascadeLink have a way of dealing with 2D shapes? I've been playing around with it a bit and haven't found any 2D shapes that OpenCascadeShape seems to recognize.

The goal is to get segments in a format suitable for direct import into ANSYS (STEP or IGES and maybe one other format).

Why does Mathematica 10.4 load opencascade lib failed?

I would like to compile the OpenCascadeLink to Mathematica 10.4 on the Windows X86-64 platform. However, I noticed that FindLibrary[] cannot load the DLL.

libDir = NotebookDirectory[] <> "open_cascade_prebuilt\\lib"

preLoadLibs = FileNames["*.*", libDir]

LibraryLoad @ preLoadLibs[[1]]

LibraryLoad @ preLoadLibs[[2]]

(*
  ibraryFunction::load: The library E:\Open-Cascade-Link\open_cascade_prebuilt/lib\TKBin.dll cannot be loaded. 
*)

success = FreeQ[Union[LibraryLoad /@ preLoadLibs], $Failed]

LibraryLink`$LibraryError

(*
   Library load error 126: cannot find the specified
*)

Screenshot

image

image

Proper documentation needed

While OpenCascadeLink is potentially a very useful tool, the current documentation is just a bunch of examples, and does not actually specify the arguments, options of each function.
For example, we are shown the call
bmesh1 = OpenCascadeShapeSurfaceMeshToBoundaryMesh[shape1]
but for serious real world use, we need to be able to specify accuracy / tolerance of the conversion process. How is that controlled?
(I am assuming that it can be controlled, which is of course essential).

A proper specification of each function is needed.

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.