MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0027006Community[OCCT] OCCT:Modeling Algorithmspublic2015-12-16 20:132017-12-05 17:09
ReporterIstvan Csanady 
Assigned Toifv 
PrioritynormalSeverityminor 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0027006: BRepOffsetAPI_MakeOffset crash
Description#include < BRepOffsetAPI_MakeOffset.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepTools.hxx>
#include <iostream>

int main()
{

auto shapeString = R"(CASCADE Topology V1, (c) Matra-Datavision
    Locations 2
    1
    1 0 0 0
    0 1 0 0
    0 0 1 3.1
    2 1 -1 0
    Curve2ds 2
    1 0 -3.1000000000000001 1 0
    2 8.1809580337423409 -1.4102593200355098 0.97904825574477827 0.20362836964211856 -0.20362836964211856 0.97904825574477827 0.76074347415551635
    Curves 1
    2 4.8190419662576591 7.41025932003551 6.5869177066726152 0 0 1 -0.97904825574477827 -0.20362836964211856 0 0.20362836964211856 -0.97904825574477827 0 0.76074347415551635
    Polygon3D 0
    PolygonOnTriangulations 2
    42 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 3
    p 0.1 1 0 0.153248422126331 0.306496844252663 0.459745266378994 0.612993688505326 0.766242110631657 0.919490532757989 1.07273895488432 1.22598737701065 1.37923579913698 1.53248422126331 1.68573264338965 1.83898106551598 1.99222948764231 2.14547790976864 2.29872633189497 2.4519747540213 2.60522317614763 2.75847159827397 2.9117200204003 3.06496844252663 3.21821686465296 3.37146528677929 3.52471370890562 3.67796213103195 3.83121055315828 3.98445897528462 4.13770739741095 4.29095581953728 4.44420424166361 4.59745266378994 4.75070108591627 4.90394950804261 5.05719793016894 5.21044635229527 5.3636947744216 5.51694319654793 5.67019161867426 5.8234400408006 5.97668846292693 6.12993688505326 6.28318530717959
    42 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1
    p 0.1 1 0 0.153248422126331 0.306496844252663 0.459745266378994 0.612993688505326 0.766242110631657 0.919490532757989 1.07273895488432 1.22598737701065 1.37923579913698 1.53248422126331 1.68573264338965 1.83898106551598 1.99222948764231 2.14547790976864 2.29872633189497 2.4519747540213 2.60522317614763 2.75847159827397 2.9117200204003 3.06496844252663 3.21821686465296 3.37146528677929 3.52471370890562 3.67796213103195 3.83121055315828 3.98445897528462 4.13770739741095 4.29095581953728 4.44420424166361 4.59745266378994 4.75070108591627 4.90394950804261 5.05719793016894 5.21044635229527 5.3636947744216 5.51694319654793 5.67019161867426 5.8234400408006 5.97668846292693 6.12993688505326 6.28318530717959
    Surfaces 2
    2 4.8190419662576591 7.41025932003551 6.5869177066726152 -0 -0 -1 -0.97904825574477827 -0.20362836964211856 0 0.20362836964211856 -0.97904825574477827 -0 0.76074347415551635
    1 13 6 6.5869177066726152 0 0 1 -1 0 0 0 -1 0
    Triangulations 2
    84 82 1 0.0022321726013457
    4.07423739481648 7.25535036667734 6.58691770667262 4.07423739481648 7.25535036667734 9.68691770667261 4.07423739481648 7.25535036667734 9.68691770667261 4.10661292960945 7.14347194924989 9.68691770667261 4.1556871971946 7.03784680167516 9.68691770667261 4.22030993833316 6.94095068788858 9.68691770667261 4.29896645074454 6.85505477067198 9.68691770667261 4.38981309244397 6.7821723775229 9.68691770667261 4.49072049514808 6.72401180996451 9.68691770667261 4.59932347486262 6.68193630240577 9.68691770667261 4.7130764697907 6.6569320690823 9.68691770667261 4.82931320614378 6.64958518803061 9.68691770667261 4.94530919333942 6.66006786391562 9.68691770667261 5.05834558375141 6.68813439169928 9.68691770667261 5.16577290019369 6.73312691575843 9.68691770667261 5.26507313742001 6.79399084946303 9.68691770667261 5.35391878203279 6.86929959379291 9.68691770667261 5.43022736742436 6.95728797560972 9.68691770667261 5.4922102850293 7.05589362181916 9.68691770667261 5.53841470779325 7.16280529964835 9.68691770667261 5.56775764320767 7.27551708998311 9.68691770667261 5.57955131773636 7.39138712398809 9.68691770667261 5.57351929764422 7.50769950627308 9.68691770667261 5.54980296836972 7.62172797317914 9.68691770667261 5.50895822057002 7.73079979408803 9.68691770667261 5.45194242051513 7.83235841796263 9.68691770667261 5.380091970234 7.92402339673643 9.68691770667261 5.2950909833836 8.0036461809986 9.68691770667261 5.1989318110522 8.06936048017118 9.68691770667261 5.09386834273852 8.11962600677841 9.68691770667261 4.98236317709216 8.15326457947972 9.68691770667261 4.86702990068848 8.16948773864171 9.68691770667261 4.75057182777443 8.16791522716373 9.68691770667261 4.63571863687383 8.14858390338204 9.68691770667261 4.52516238943634 8.11194687714161 9.68691770667261 4.42149443019876 8.0588628892854 9.68691770667261 4.32714464826073 7.99057618349687 9.68691770667261 4.24432452254372 7.90868734228257 9.68691770667261 4.17497528659944 7.8151157706748 9.68691770667261 4.12072242774075 7.71205470700446 9.68691770667261 4.08283758699671 7.60191981525348 9.68691770667261 4.06220875292464 7.48729256393849 9.68691770667261 4.05931944791101 7.37085971867677 9.68691770667261 4.07423739481648 7.25535036667734 6.58691770667262 4.10661292960945 7.14347194924989 6.58691770667262 4.1556871971946 7.03784680167516 6.58691770667262 4.22030993833316 6.94095068788858 6.58691770667262 4.29896645074454 6.85505477067198 6.58691770667262 4.38981309244397 6.7821723775229 6.58691770667262 4.49072049514808 6.72401180996451 6.58691770667262 4.59932347486262 6.68193630240577 6.58691770667262 4.7130764697907 6.6569320690823 6.58691770667262 4.82931320614378 6.64958518803061 6.58691770667262 4.94530919333942 6.66006786391562 6.58691770667262 5.05834558375141 6.68813439169928 6.58691770667262 5.16577290019369 6.73312691575843 6.58691770667262 5.26507313742001 6.79399084946303 6.58691770667262 5.35391878203279 6.86929959379291 6.58691770667262 5.43022736742436 6.95728797560972 6.58691770667262 5.4922102850293 7.05589362181916 6.58691770667262 5.53841470779325 7.16280529964835 6.58691770667262 5.56775764320767 7.27551708998311 6.58691770667262 5.57955131773636 7.39138712398809 6.58691770667262 5.57351929764422 7.50769950627308 6.58691770667262 5.54980296836972 7.62172797317914 6.58691770667262 5.50895822057002 7.73079979408803 6.58691770667262 5.45194242051513 7.83235841796263 6.58691770667262 5.380091970234 7.92402339673643 6.58691770667262 5.2950909833836 8.0036461809986 6.58691770667262 5.1989318110522 8.06936048017118 6.58691770667262 5.09386834273852 8.11962600677841 6.58691770667262 4.98236317709216 8.15326457947972 6.58691770667262 4.86702990068848 8.16948773864171 6.58691770667262 4.75057182777443 8.16791522716373 6.58691770667262 4.63571863687383 8.14858390338204 6.58691770667262 4.52516238943634 8.11194687714161 6.58691770667262 4.42149443019876 8.0588628892854 6.58691770667262 4.32714464826073 7.99057618349687 6.58691770667262 4.24432452254372 7.90868734228257 6.58691770667262 4.17497528659944 7.8151157706748 6.58691770667262 4.12072242774075 7.71205470700446 6.58691770667262 4.08283758699671 7.60191981525348 6.58691770667262 4.06220875292464 7.48729256393849 6.58691770667262 4.05931944791101 7.37085971867677 6.58691770667262 0 0 0 -3.1 6.28318530717959 -3.1 0.153248422126331 -3.1 0.306496844252663 -3.1 0.459745266378994 -3.1 0.612993688505326 -3.1 0.766242110631657 -3.1 0.919490532757989 -3.1 1.07273895488432 -3.1 1.22598737701065 -3.1 1.37923579913698 -3.1 1.53248422126331 -3.1 1.68573264338965 -3.1 1.83898106551598 -3.1 1.99222948764231 -3.1 2.14547790976864 -3.1 2.29872633189497 -3.1 2.4519747540213 -3.1 2.60522317614763 -3.1 2.75847159827397 -3.1 2.9117200204003 -3.1 3.06496844252663 -3.1 3.21821686465296 -3.1 3.37146528677929 -3.1 3.52471370890562 -3.1 3.67796213103195 -3.1 3.83121055315828 -3.1 3.98445897528462 -3.1 4.13770739741095 -3.1 4.29095581953728 -3.1 4.44420424166361 -3.1 4.59745266378994 -3.1 4.75070108591627 -3.1 4.90394950804261 -3.1 5.05719793016894 -3.1 5.21044635229527 -3.1 5.3636947744216 -3.1 5.51694319654793 -3.1 5.67019161867426 -3.1 5.8234400408006 -3.1 5.97668846292693 -3.1 6.12993688505326 -3.1 6.28318530717959 0 0.153248422126331 0 0.306496844252663 0 0.459745266378994 0 0.612993688505326 0 0.766242110631657 0 0.919490532757989 0 1.07273895488432 0 1.22598737701065 0 1.37923579913698 0 1.53248422126331 0 1.68573264338965 0 1.83898106551598 0 1.99222948764231 0 2.14547790976864 0 2.29872633189497 0 2.4519747540213 0 2.60522317614763 0 2.75847159827397 0 2.9117200204003 0 3.06496844252663 0 3.21821686465296 0 3.37146528677929 0 3.52471370890562 0 3.67796213103195 0 3.83121055315828 0 3.98445897528462 0 4.13770739741095 0 4.29095581953728 0 4.44420424166361 0 4.59745266378994 0 4.75070108591627 0 4.90394950804261 0 5.05719793016894 0 5.21044635229527 0 5.3636947744216 0 5.51694319654793 0 5.67019161867426 0 5.8234400408006 0 5.97668846292693 0 6.12993688505326 0 63 21 22 84 42 43 63 62 21 84 83 42 44 43 3 44 84 43 64 22 23 64 63 22 45 1 2 45 2 4 65 23 24 65 64 23 46 4 5 46 45 4 66 24 25 66 65 24 47 5 6 67 25 26 47 46 5 67 66 25 48 47 6 48 6 7 68 26 27 68 67 26 49 48 7 49 7 8 69 27 28 69 68 27 50 8 9 50 49 8 70 28 29 70 69 28 51 9 10 51 50 9 71 29 30 71 70 29 52 10 11 52 51 10 72 30 31 72 71 30 53 11 12 53 52 11 73 72 31 73 31 32 54 12 13 54 53 12 74 73 32 74 32 33 55 13 14 55 54 13 75 74 33 75 33 34 56 14 15 56 55 14 76 75 34 76 34 35 57 15 16 77 76 35 57 56 15 77 35 36 58 16 17 78 77 36 58 57 16 78 36 37 79 78 37 59 17 18 79 37 38 59 58 17 80 79 38 60 18 19 80 38 39 60 59 18 81 80 39 81 39 40 61 19 20 61 60 19 82 81 40 82 40 41 62 20 21 62 61 20 83 82 41 83 41 42
    41 39 1 2.67063594730717e-15
    4.07423739481648 7.25535036667734 6.58691770667261 4.10661292960945 7.14347194924989 6.58691770667262 4.1556871971946 7.03784680167516 6.58691770667262 4.22030993833316 6.94095068788858 6.58691770667262 4.29896645074454 6.85505477067198 6.58691770667262 4.38981309244397 6.7821723775229 6.58691770667262 4.49072049514808 6.72401180996451 6.58691770667262 4.59932347486262 6.68193630240577 6.58691770667262 4.7130764697907 6.6569320690823 6.58691770667262 4.82931320614378 6.64958518803061 6.58691770667262 4.94530919333942 6.66006786391562 6.58691770667262 5.05834558375141 6.68813439169928 6.58691770667262 5.16577290019369 6.73312691575843 6.58691770667262 5.26507313742001 6.79399084946303 6.58691770667262 5.35391878203279 6.86929959379291 6.58691770667262 5.43022736742436 6.95728797560972 6.58691770667262 5.4922102850293 7.05589362181916 6.58691770667262 5.53841470779325 7.16280529964835 6.58691770667262 5.56775764320767 7.27551708998311 6.58691770667262 5.57955131773636 7.39138712398809 6.58691770667262 5.57351929764422 7.50769950627308 6.58691770667262 5.54980296836972 7.62172797317914 6.58691770667262 5.50895822057002 7.73079979408803 6.58691770667262 5.45194242051513 7.83235841796263 6.58691770667262 5.380091970234 7.92402339673643 6.58691770667262 5.2950909833836 8.0036461809986 6.58691770667262 5.1989318110522 8.06936048017118 6.58691770667262 5.09386834273852 8.11962600677841 6.58691770667262 4.98236317709216 8.15326457947972 6.58691770667262 4.86702990068848 8.16948773864171 6.58691770667262 4.75057182777443 8.16791522716373 6.58691770667262 4.63571863687383 8.14858390338204 6.58691770667262 4.52516238943634 8.11194687714161 6.58691770667262 4.42149443019876 8.0588628892854 6.58691770667262 4.32714464826073 7.99057618349687 6.58691770667262 4.24432452254372 7.90868734228257 6.58691770667262 4.17497528659944 7.8151157706748 6.58691770667262 4.12072242774075 7.71205470700446 6.58691770667262 4.08283758699671 7.60191981525348 6.58691770667262 4.06220875292464 7.48729256393849 6.58691770667262 4.05931944791101 7.37085971867677 6.58691770667262 8.92576260518352 -1.25535036667734 8.89338707039055 -1.14347194924989 8.8443128028054 -1.03784680167516 8.77969006166684 -0.940950687888581 8.70103354925546 -0.855054770671977 8.61018690755603 -0.7821723775229 8.50927950485192 -0.724011809964511 8.40067652513738 -0.681936302405769 8.2869235302093 -0.656932069082303 8.17068679385622 -0.649585188030611 8.05469080666058 -0.660067863915616 7.94165441624859 -0.688134391699277 7.83422709980631 -0.733126915758433 7.73492686257999 -0.793990849463031 7.64608121796721 -0.869299593792912 7.56977263257564 -0.957287975609718 7.5077897149707 -1.05589362181916 7.46158529220675 -1.16280529964835 7.43224235679233 -1.27551708998311 7.42044868226364 -1.39138712398809 7.42648070235578 -1.50769950627308 7.45019703163028 -1.62172797317914 7.49104177942998 -1.73079979408803 7.54805757948487 -1.83235841796263 7.619908029766 -1.92402339673643 7.7049090166164 -2.0036461809986 7.8010681889478 -2.06936048017118 7.90613165726148 -2.11962600677841 8.01763682290784 -2.15326457947972 8.13297009931152 -2.16948773864171 8.24942817222557 -2.16791522716373 8.36428136312617 -2.14858390338204 8.47483761056366 -2.11194687714161 8.57850556980124 -2.0588628892854 8.67285535173927 -1.99057618349687 8.75567547745628 -1.90868734228257 8.82502471340056 -1.8151157706748 8.87927757225925 -1.71205470700446 8.91716241300329 -1.60191981525348 8.93779124707536 -1.48729256393849 8.94068055208899 -1.37085971867677 5 1 2 5 2 3 5 3 4 5 6 7 5 7 8 5 8 9 5 9 10 5 10 11 5 11 12 5 12 13 5 13 14 5 14 15 5 15 16 5 16 17 5 17 18 5 18 19 5 19 20 5 20 21 5 21 22 5 22 23 5 23 24 5 24 25 5 25 26 5 26 27 5 27 28 5 28 29 5 29 30 5 30 31 5 31 32 5 32 33 5 33 34 5 34 35 5 35 36 5 36 37 5 37 38 5 38 39 5 39 40 5 40 41 5 41 1
    
    TShapes 4
    Ve
    1.01010150382506e-05
    4.07423739481648 7.25535036667734 9.68691770667261
    0 0
    
    0101101
    *
    Ed
    1.01010150382506e-05 1 1 0
    1 1 0 0 6.28318530717959
    2 1 1 2 0 6.28318530717959
    2 2 2 0 0 6.28318530717959
    6 1 1 2
    6 2 2 0
    0
    
    0101000
    +4 2 -4 2 *
    Wi
    
    0101100
    +3 0 *
    Co
    
    1100000
    +2 1 *
    
    +1 0 )";
    
    std::stringstream sstream(shapeString);
    TopoDS_Shape shape;
    BRep_Builder b;
    BRepTools::Read(shape, sstream, b);
    for (TopExp_Explorer exp(shape, TopAbs_WIRE); exp.More(); exp.Next())
    {
        BRepOffsetAPI_MakeOffset offsetMaker(TopoDS::Wire(exp.Current()));
        offsetMaker.Perform(-0.0057277031586866305);
    }
}
Steps To Reproducecircle c 0 0 0 0.1
mkedge e c
wire w e
mkoffset r w 1 -0.005
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
(0049223)
msv (developer)
2015-12-17 11:40

I have found that offset is not built in this case because of an error in the algorithm that takes place when the shape type is circle, its radius is less than or equal to 1, and offset value is negative.

So, the following simple draw script can be used to reproduce this error:

circle c 0 0 0 0.1
mkedge e c
wire w e
mkoffset r w 1 -0.005

- Issue History
Date Modified Username Field Change
2015-12-16 20:13 Istvan Csanady New Issue
2015-12-16 20:13 Istvan Csanady Assigned To => msv
2015-12-17 11:40 msv Note Added: 0049223
2015-12-17 11:41 msv Assigned To msv => ifv
2015-12-17 11:41 msv Status new => assigned
2015-12-17 11:41 msv Target Version 7.0.0 => 7.1.0
2015-12-17 11:41 msv Steps to Reproduce Updated View Revisions
2016-10-28 11:54 msv Target Version 7.1.0 => 7.2.0
2017-07-21 11:34 msv Target Version 7.2.0 => 7.3.0
2017-12-05 17:09 msv Target Version 7.3.0 => 7.4.0*


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker